1
0
Fork 0
mirror of synced 2024-06-14 00:34:51 +12:00

feat: move create runtimr logic to controller

This commit is contained in:
Christy Jacob 2022-02-14 04:20:12 +04:00
parent b95434d012
commit b42da9e996
2 changed files with 2 additions and 1 deletions

View file

@ -330,6 +330,7 @@ App::post('/v1/runtimes')
->setCpus(App::getEnv('_APP_FUNCTIONS_CPUS', 0))
->setMemory(App::getEnv('_APP_FUNCTIONS_MEMORY', 256))
->setSwap(App::getEnv('_APP_FUNCTIONS_MEMORY_SWAP', 256));
$id = $orchestration->run(
image: $baseImage,
name: $container,

View file

@ -138,11 +138,11 @@ class BuildsV1 extends Worker
$build->setAttribute('stdout', $response['stdout']);
} catch (\Throwable $th) {
$endtime = \time();
Console::error($th->getMessage());
$build->setAttribute('endTime', $endtime);
$build->setAttribute('duration', $endtime - $startTime);
$build->setAttribute('status', 'failed');
$build->setAttribute('stderr', $th->getMessage());
Console::error($th->getMessage());
}
$build = $dbForProject->updateDocument('builds', $buildId, $build);