From d2362aeab0427fa7740f8d944873a0ef036d7fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 21 Nov 2022 11:43:20 +0000 Subject: [PATCH] Improve performance --- app/controllers/api/functions.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 871998e6de..bfc1ccba42 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1080,7 +1080,7 @@ App::post('/v1/functions/:functionId/executions') 'functionId' => $function->getId(), 'deploymentId' => $deployment->getId(), 'trigger' => 'http', // http / schedule / event - 'status' => 'waiting', // waiting / processing / completed / failed + 'status' => $async ? 'waiting' : 'processing', // waiting / processing / completed / failed 'statusCode' => 0, 'response' => '', 'stderr' => '', @@ -1132,9 +1132,6 @@ App::post('/v1/functions/:functionId/executions') ->dynamic($execution, Response::MODEL_EXECUTION); } - $execution->setAttribute('status', 'processing'); - Authorization::skip(fn () => $dbForProject->updateDocument('executions', $executionId, $execution)); - $vars = array_reduce($function['vars'] ?? [], function (array $carry, Document $var) { $carry[$var->getAttribute('key')] = $var->getAttribute('value') ?? ''; return $carry;