mirror of
https://github.com/appwrite/appwrite
synced 2026-05-23 08:58:35 +00:00
Merge pull request #11134 from appwrite/fix-execution-status-update
This commit is contained in:
commit
6478499f1c
1 changed files with 12 additions and 3 deletions
|
|
@ -462,7 +462,11 @@ class Functions extends Action
|
|||
if ($execution->getAttribute('status') !== 'processing') {
|
||||
$execution->setAttribute('status', 'processing');
|
||||
|
||||
$execution = $dbForProject->updateDocument('executions', $executionId, $execution);
|
||||
try {
|
||||
$execution = $dbForProject->updateDocument('executions', $executionId, $execution);
|
||||
} catch (\Throwable $e) {
|
||||
$log->addExtra('updateError', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
$durationStart = \microtime(true);
|
||||
|
|
@ -605,6 +609,13 @@ class Functions extends Action
|
|||
$error = $th->getMessage();
|
||||
$errorCode = $th->getCode();
|
||||
} finally {
|
||||
/** Update execution status */
|
||||
try {
|
||||
$execution = $dbForProject->updateDocument('executions', $executionId, $execution);
|
||||
} catch (\Throwable $e) {
|
||||
$log->addExtra('updateError', $e->getMessage());
|
||||
}
|
||||
|
||||
/** Trigger usage queue */
|
||||
$queueForStatsUsage
|
||||
->setProject($project)
|
||||
|
|
@ -621,8 +632,6 @@ class Functions extends Action
|
|||
;
|
||||
}
|
||||
|
||||
$execution = $dbForProject->updateDocument('executions', $executionId, $execution);
|
||||
|
||||
$executionModel = new Execution();
|
||||
$realtimeExecution = $executionModel->filter(new Document($execution->getArrayCopy()));
|
||||
$realtimeExecution = $realtimeExecution->getArrayCopy(\array_keys($executionModel->getRules()));
|
||||
|
|
|
|||
Loading…
Reference in a new issue