From d405f74c5461d2aa36b61bb3ee9f7a124e5c5895 Mon Sep 17 00:00:00 2001 From: fogelito Date: Sat, 2 Jul 2022 09:01:54 +0300 Subject: [PATCH] worker change for time --- app/workers/functions.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/workers/functions.php b/app/workers/functions.php index 55d71ef368..90f12b895e 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -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());