1
0
Fork 0
mirror of synced 2024-09-20 03:17:30 +12:00

Auto update V3 Runtimes into V4 Runtimes on execution

This commit is contained in:
Bradley Schofield 2024-07-22 11:33:31 +09:00
parent efa1924f26
commit 8e61b2149f

View file

@ -1621,6 +1621,13 @@ 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)) {