Make untarring the code file a blocking task
This commit is contained in:
parent
f388c44e20
commit
ca3d677596
|
@ -425,15 +425,24 @@ class FunctionsV1 extends Worker
|
||||||
" --workdir /usr/local/src".
|
" --workdir /usr/local/src".
|
||||||
" ".\implode(" ", $vars).
|
" ".\implode(" ", $vars).
|
||||||
" {$runtime['image']}".
|
" {$runtime['image']}".
|
||||||
" sh -c 'mv /tmp/code.tar.gz /usr/local/src/code.tar.gz && tar -zxf /usr/local/src/code.tar.gz --strip 1 && rm /usr/local/src/code.tar.gz && tail -f /dev/null'"
|
" tail -f /dev/null"
|
||||||
, '', $stdout, $stderr, 30);
|
, '', $stdout, $stderr, 30);
|
||||||
|
|
||||||
$executionEnd = \microtime(true);
|
|
||||||
|
|
||||||
if($exitCode !== 0) {
|
if($exitCode !== 0) {
|
||||||
throw new Exception('Failed to create function environment: '.$stderr);
|
throw new Exception('Failed to create function environment: '.$stderr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$exitCodeUntar = Console::execute("docker exec ".
|
||||||
|
$container.
|
||||||
|
" sh -c 'mv /tmp/code.tar.gz /usr/local/src/code.tar.gz && tar -zxf /usr/local/src/code.tar.gz --strip 1 && rm /usr/local/src/code.tar.gz'"
|
||||||
|
, '', $stdout, $stderr, 60);
|
||||||
|
|
||||||
|
if($exitCodeUntar !== 0) {
|
||||||
|
throw new Exception('Failed to extract tar: '.$stderr);
|
||||||
|
}
|
||||||
|
|
||||||
|
$executionEnd = \microtime(true);
|
||||||
|
|
||||||
$list[$container] = [
|
$list[$container] = [
|
||||||
'name' => $container,
|
'name' => $container,
|
||||||
'online' => true,
|
'online' => true,
|
||||||
|
|
Loading…
Reference in a new issue