From a34223748b326de1e24509d69c555c468dde2f84 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 16 Nov 2022 17:32:35 +0000 Subject: [PATCH 1/2] fix: return types --- app/workers/builds.php | 2 ++ composer.lock | 2 +- src/Appwrite/Event/Event.php | 10 +++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/workers/builds.php b/app/workers/builds.php index 1fa86b99a8..a130d4f4f3 100644 --- a/app/workers/builds.php +++ b/app/workers/builds.php @@ -123,10 +123,12 @@ class BuildsV1 extends Worker /** Trigger Functions */ $pools = $register->get('pools'); $connection = $pools->get('queue')->pop(); + $functions = new Func($connection->getResource()); $functions ->from($deploymentUpdate) ->trigger(); + $connection->reclaim(); /** Trigger Realtime */ diff --git a/composer.lock b/composer.lock index 517065af56..1862ac982c 100644 --- a/composer.lock +++ b/composer.lock @@ -5302,5 +5302,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.1.0" + "plugin-api-version": "2.3.0" } diff --git a/src/Appwrite/Event/Event.php b/src/Appwrite/Event/Event.php index 6e3401e11b..f88d2e94a6 100644 --- a/src/Appwrite/Event/Event.php +++ b/src/Appwrite/Event/Event.php @@ -116,9 +116,9 @@ class Event /** * Get project for this event. * - * @return Document + * @return ?Document */ - public function getProject(): Document + public function getProject(): ?Document { return $this->project; } @@ -137,11 +137,11 @@ class Event } /** - * Get project for this event. + * Get user responsible for triggering this event. * - * @return Document + * @return ?Document */ - public function getUser(): Document + public function getUser(): ?Document { return $this->user; } From 657f2bc3344f3711c886422592f4bc9033f7b292 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 16 Nov 2022 23:25:26 +0530 Subject: [PATCH 2/2] fix: linter --- app/workers/builds.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/workers/builds.php b/app/workers/builds.php index a130d4f4f3..e22807d30e 100644 --- a/app/workers/builds.php +++ b/app/workers/builds.php @@ -123,7 +123,7 @@ class BuildsV1 extends Worker /** Trigger Functions */ $pools = $register->get('pools'); $connection = $pools->get('queue')->pop(); - + $functions = new Func($connection->getResource()); $functions ->from($deploymentUpdate)