From fd051a78f595b21922b81a01e2e1479456239162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Ba=C4=8Do?= Date: Mon, 12 Dec 2022 12:07:35 +0100 Subject: [PATCH] Get rid of comment block --- app/workers/functions.php | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/app/workers/functions.php b/app/workers/functions.php index 016eff44f5..10f53ac0e0 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -291,23 +291,28 @@ $server->job() $data = $payload['data'] ?? null; $execution = new Document($payload['execution'] ?? []); - /** - * Handle Schedule and HTTP execution. - */ - $execute( - project: $project, - function: $function, - dbForProject: $dbForProject, - queueForFunctions: $queueForFunctions, - trigger: $type, - executionId: $execution->isEmpty() ? null : $execution->getId(), - user: $user->isEmpty() ? null : $user, - data: $data, - jwt: $jwt, - statsd: $statsd, - event: null, - eventData: null, - ); + switch ($type) { + case 'http': + case 'schedule': + $execute( + project: $project, + function: $function, + dbForProject: $dbForProject, + queueForFunctions: $queueForFunctions, + trigger: $type, + executionId: $execution->isEmpty() ? null : $execution->getId(), + user: $user->isEmpty() ? null : $user, + data: $data, + jwt: $jwt, + statsd: $statsd, + event: null, + eventData: null, + ); + break; + default: + throw new \Exception('Invalid build type'); + break; + } }); $server->workerStart();