From b2155acc5668c2a3ddbd8766853b4aa5d030bcad Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 7 Dec 2025 21:48:09 +0000 Subject: [PATCH 1/3] Initial plan From be5f066dc3e644f124b747e4370d7db4249f5552 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 7 Dec 2025 21:53:18 +0000 Subject: [PATCH 2/3] Fix ScheduleExecutions bug: correct comparison operator to properly execute scheduled tasks Co-authored-by: stnguyen90 <1477010+stnguyen90@users.noreply.github.com> --- src/Appwrite/Platform/Tasks/ScheduleExecutions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php index 83a3f51b03..b08f78e73c 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php @@ -50,7 +50,7 @@ class ScheduleExecutions extends ScheduleBase } $scheduledAt = new \DateTime($schedule['schedule']); - if ($scheduledAt <= $intervalEnd) { + if ($scheduledAt > $intervalEnd) { continue; } From 1cf8b103a8db76680fbfdf5d0ac695bfbc467f63 Mon Sep 17 00:00:00 2001 From: Steven Nguyen <1477010+stnguyen90@users.noreply.github.com> Date: Mon, 8 Dec 2025 19:23:35 +0000 Subject: [PATCH 3/3] chore: only sleep if delay is greater than 0 seconds This prevents the warning: Swoole\Coroutine::sleep(): Timer must be greater than or equal to 0.001 --- 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 b08f78e73c..3f08815d8c 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php @@ -64,7 +64,9 @@ class ScheduleExecutions extends ScheduleBase $this->updateProjectAccess($schedule['project'], $dbForPlatform); \go(function () use ($queueForFunctions, $schedule, $scheduledAt, $delay, $data) { - Co::sleep($delay); + if ($delay > 0) { + Co::sleep($delay); + } $queueForFunctions->setType('schedule') // Set functionId instead of function as we don't have $dbForProject