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:
parent
80f5ded0e3
commit
fbd277f6aa
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue