1
0
Fork 0
mirror of synced 2024-05-20 12:42:39 +12:00

executor: pass build timeout to runtimes (#7350)

open-runtimes executor (v1/runtimes) supports passing a timeout parameter that defaults to 600 seconds.

->param('timeout', 600, new Integer(), 'Commands execution time in seconds.', true)

https://github.com/open-runtimes/executor/blob/main/app/http.php#L383

This change passes the _APP_FUNCTIONS_BUILD_TIMEOUT env var.
This commit is contained in:
Ben Humphries 2024-01-04 05:46:08 -05:00 committed by GitHub
parent 80f5ded0e3
commit fbd277f6aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -72,6 +72,7 @@ class Executor
) {
$runtimeId = "$projectId-$deploymentId-build";
$route = "/runtimes";
$timeout = (int) App::getEnv('_APP_FUNCTIONS_BUILD_TIMEOUT', 900);
$params = [
'runtimeId' => $runtimeId,
'source' => $source,
@ -84,10 +85,9 @@ class Executor
'cpus' => $this->cpus,
'memory' => $this->memory,
'version' => $version,
'timeout' => $timeout,
];
$timeout = (int) App::getEnv('_APP_FUNCTIONS_BUILD_TIMEOUT', 900);
$response = $this->call(self::METHOD_POST, $route, [ 'x-opr-runtime-id' => $runtimeId ], $params, true, $timeout);
$status = $response['headers']['status-code'];
@ -111,7 +111,7 @@ class Executor
string $projectId,
callable $callback
) {
$timeout = (int) App::getEnv('_APP_FUNCTIONS_BUILD_TIMEOUT', 900);
$timeout = (int) App::getEnv('_APP_FUNCTIONS_BUILD_TIMEOUT', 900);
$runtimeId = "$projectId-$deploymentId-build";
$route = "/runtimes/{$runtimeId}/logs";