1
0
Fork 0
mirror of synced 2024-06-29 19:50:26 +12:00

Improve Executor reliability

This commit is contained in:
Bradley Schofield 2021-09-30 15:36:09 +01:00
parent 7adee918d1
commit 4e5ac770ff
2 changed files with 15 additions and 2 deletions

View file

@ -495,6 +495,11 @@ function runBuildStage(string $tagID, Document $function, string $projectID, Dat
'buildStderr' => $buildStderr,
]));
Authorization::enable();
// also remove the container if it exists
if ($id) {
$orchestration->remove($id, true);
}
}
return $tag;
@ -559,6 +564,11 @@ function createRuntimeServer(string $functionId, string $projectId, Document $ta
$activeFunctions->del($container);
}
// Check if tag hasn't failed
if ($tag->getAttribute('status') == 'failed') {
throw new Exception('Tag build failed, please check your logs.', 500);
}
// Check if tag is built yet.
if ($tag->getAttribute('status') !== 'ready') {
throw new Exception('Tag is not built yet', 500);
@ -788,6 +798,7 @@ function execute(string $trigger, string $projectId, string $executionId, string
$executionStart = \microtime(true);
$exitCode = 0;
$statusCode = 200;
$errNo = -1;
$attempts = 0;
@ -824,6 +835,8 @@ function execute(string $trigger, string $projectId, string $executionId, string
$executorResponse = \curl_exec($ch);
$statusCode = \curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error = \curl_error($ch);
$errNo = \curl_errno($ch);

4
composer.lock generated
View file

@ -119,7 +119,7 @@
"source": {
"type": "git",
"url": "https://github.com/PineappleIOnic/php-runtimes.git",
"reference": "47c963761d26c7f369c9a8a76e2a050eb009b479"
"reference": "fd85bad3c975ccfe4e7f35bafbc8c606fc3fdf79"
},
"require": {
"php": ">=8.0",
@ -156,7 +156,7 @@
"php",
"runtimes"
],
"time": "2021-09-28T12:46:04+00:00"
"time": "2021-09-29T15:50:27+00:00"
},
{
"name": "chillerlan/php-qrcode",