diff --git a/src/Appwrite/Platform/Tasks/ScheduleExecutions.php b/src/Appwrite/Platform/Tasks/ScheduleExecutions.php index 83a3f51b03..3f08815d8c 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; } @@ -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