Improvement v3 -> v4 transition

This commit is contained in:
Bradley Schofield 2024-07-22 19:42:29 +09:00
parent 9e3c5b9368
commit 4f558d35be
2 changed files with 13 additions and 7 deletions

View file

@ -1621,13 +1621,6 @@ App::post('/v1/functions/:functionId/executions')
$version = $function->getAttribute('version', 'v2');
$runtimes = Config::getParam($version === 'v2' ? 'runtimes-v2' : 'runtimes', []);
/** Auto-update v3 runtimes into v4, remove me after we do migrations */
if ($version === 'v3') {
$function->setAttribute('version', 'v4');
$function = $dbForProject->updateDocument('functions', $function->getId(), $function);
$version = 'v4';
}
$runtime = (isset($runtimes[$function->getAttribute('runtime', '')])) ? $runtimes[$function->getAttribute('runtime', '')] : null;
if (\is_null($runtime)) {

View file

@ -75,6 +75,12 @@ class Executor
$runtimeId = "$projectId-$deploymentId-build";
$route = "/runtimes";
$timeout = (int) System::getEnv('_APP_FUNCTIONS_BUILD_TIMEOUT', 900);
// Remove after migration
if ($version == 'v3') {
$version = 'v4';
}
$params = [
'runtimeId' => $runtimeId,
'source' => $source,
@ -188,6 +194,13 @@ class Executor
$runtimeId = "$projectId-$deploymentId";
$route = '/runtimes/' . $runtimeId . '/execution';
// Remove after migration
if ($version == 'v3') {
$version = 'v4';
}
$params = [
'runtimeId' => $runtimeId,
'variables' => $variables,