From e976bd3cb1ea022f0323ab2a46211dbaa5adcc64 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 16 Nov 2022 11:22:19 +0530 Subject: [PATCH] fix: event triggers --- app/workers/functions.php | 2 -- src/Appwrite/Event/Event.php | 2 -- src/Appwrite/Event/Func.php | 4 +++- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/workers/functions.php b/app/workers/functions.php index 9d1dc0372d..e2a31afd75 100644 --- a/app/workers/functions.php +++ b/app/workers/functions.php @@ -51,7 +51,6 @@ Server::setResource('execute', function () { $user ??= new Document(); $functionId = $function->getId(); $deploymentId = $function->getAttribute('deployment', ''); - var_dump("Deployment ID : ", $deploymentId); /** Check if deployment exists */ $deployment = $dbForProject->getDocument('deployments', $deploymentId); @@ -286,7 +285,6 @@ $server->job() $project = new Document($payload['project'] ?? []); $function = new Document($payload['function'] ?? []); $user = new Document($payload['user'] ?? []); - var_dump("Function : ", $function); if ($project->getId() === 'console') { return; diff --git a/src/Appwrite/Event/Event.php b/src/Appwrite/Event/Event.php index 222cf59444..6e3401e11b 100644 --- a/src/Appwrite/Event/Event.php +++ b/src/Appwrite/Event/Event.php @@ -337,8 +337,6 @@ class Event default => false }; - - return [ 'type' => $type, 'resource' => $resource, diff --git a/src/Appwrite/Event/Func.php b/src/Appwrite/Event/Func.php index 9fdcc4f8f3..b114ca4b59 100644 --- a/src/Appwrite/Event/Func.php +++ b/src/Appwrite/Event/Func.php @@ -147,6 +147,8 @@ class Func extends Event { $client = new Client($this->queue, $this->connection); + $events = $this->getEvent() ? Event::generateEvents($this->getEvent(), $this->getParams()) : null; + return $client->enqueue([ 'project' => $this->project, 'user' => $this->user, @@ -155,7 +157,7 @@ class Func extends Event 'type' => $this->type, 'jwt' => $this->jwt, 'payload' => '', - 'events' => Event::generateEvents($this->getEvent(), $this->getParams()), + 'events' => $events, 'data' => $this->data, ]); }