mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
fix: stop legacy duration at the recorded build end
This commit is contained in:
1 parent
c18642eca5
commit
6e53246929
1 file changed
+4
-1
@@ -676,13 +676,16 @@ class Jobs extends Action
|
||||
|
||||
try {
|
||||
$started = (float) (new \DateTimeImmutable($startedAt))->format('U.u');
|
||||
$ended = empty($deployment->getAttribute('buildEndedAt'))
|
||||
? \microtime(true)
|
||||
: (float) (new \DateTimeImmutable($deployment->getAttribute('buildEndedAt')))->format('U.u');
|
||||
} catch (\Exception) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// A timeout is a budget, not a measurement: termination grace can
|
||||
// legitimately leave the worker running past it.
|
||||
return (int) \ceil(\max(0.0, \microtime(true) - $started));
|
||||
return (int) \ceil(\max(0.0, $ended - $started));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user