From 711dc7bd08ccff940d3c295506a831dfd660a069 Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Wed, 25 Sep 2024 09:59:51 +0100 Subject: [PATCH] feat: add logic --- app/controllers/api/functions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index ce8ba861fe..9641f0477f 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -1734,6 +1734,7 @@ App::post('/v1/functions/:functionId/executions') ->inject('queueForFunctions') ->inject('geodb') ->action(function (string $functionId, string $body, bool $async, string $path, string $method, mixed $headers, ?string $scheduledAt, Response $response, Request $request, Document $project, Database $dbForProject, Database $dbForConsole, Document $user, Event $queueForEvents, Usage $queueForUsage, Func $queueForFunctions, Reader $geodb) { + $async = \strval($async) === 'true' || \strval($async) === '1'; if (!$async && !is_null($scheduledAt)) { throw new Exception(Exception::GENERAL_BAD_REQUEST, 'Scheduled executions must run asynchronously. Set scheduledAt to a future date, or set async to true.');