From 5a56131efa480d1eff8ad43f686ef0fe3e06d1cf Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Fri, 19 Jul 2024 10:22:50 +0100 Subject: [PATCH] chore: binyamin review --- src/Appwrite/Platform/Tasks/ScheduleExecutions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php index e7364c7a4b..c5f9b40d15 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php @@ -3,6 +3,7 @@ namespace Appwrite\Platform\Tasks; use Appwrite\Event\Func; +use Swoole\Coroutine as Co; use Utopia\Database\Database; use Utopia\Pools\Group; @@ -46,8 +47,9 @@ class ScheduleExecutions extends ScheduleBase $delay = $scheduledAt->getTimestamp() - (new \DateTime())->getTimestamp(); + \go(function () use ($queueForFunctions, $schedule, $delay) { - \sleep($delay); + Co::sleep($delay); $queueForFunctions ->setType('schedule')