functions api

This commit is contained in:
fogelito
2022-07-02 17:38:53 +03:00
parent 6c6f7fb3bb
commit 73a19614e1
2 changed files with 2 additions and 6 deletions
+1 -3
View File
@@ -945,9 +945,7 @@ App::post('/v1/functions/:functionId/executions')
$execution->setAttribute('stderr', $executionResponse['stderr']);
$execution->setAttribute('time', $executionResponse['time']);
} catch (\Throwable $th) {
$created = new DateTime($execution->getCreatedAt());
$now = Database::getCurrentDateTimeObject();
$interval = $now->diff($created);
$interval = (new DateTime())->diff(new DateTime($execution->getCreatedAt()));
$execution
->setAttribute('time', (float)$interval->format('%s.%f'))
->setAttribute('status', 'failed')
+1 -3
View File
@@ -296,9 +296,7 @@ class FunctionsV1 extends Worker
->setAttribute('stderr', $executionResponse['stderr'])
->setAttribute('time', $executionResponse['time']);
} catch (\Throwable $th) {
$created = new DateTime($execution->getCreatedAt());
$now = Database::getCurrentDateTimeObject();
$interval = $now->diff($created);
$interval = (new DateTime())->diff(new DateTime($execution->getCreatedAt()));
$execution
->setAttribute('time', (float)$interval->format('%s.%f'))
->setAttribute('status', 'failed')