1
0
Fork 0
mirror of synced 2024-09-30 17:26:48 +13:00

worker change for time

This commit is contained in:
fogelito 2022-07-02 09:01:54 +03:00
parent 6d46332f96
commit d405f74c54

View file

@ -296,10 +296,11 @@ class FunctionsV1 extends Worker
->setAttribute('stderr', $executionResponse['stderr'])
->setAttribute('time', $executionResponse['time']);
} catch (\Throwable $th) {
$endtime = \microtime(true);
$time = $endtime - $execution->getCreatedAt();
$created = new DateTime($execution->getCreatedAt());
$now = Database::getCurrentDateTimeObject();
$interval = $now->diff($created);
$execution
->setAttribute('time', $time)
->setAttribute('time', (float)$interval->format('%s.%f'))
->setAttribute('status', 'failed')
->setAttribute('statusCode', $th->getCode())
->setAttribute('stderr', $th->getMessage());