diff --git a/src/Appwrite/Platform/Tasks/ScheduleBase.php b/src/Appwrite/Platform/Tasks/ScheduleBase.php index ed42a45e4e..1ec8e471bb 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleBase.php +++ b/src/Appwrite/Platform/Tasks/ScheduleBase.php @@ -70,6 +70,7 @@ abstract class ScheduleBase extends Action ); return [ + '$id' => $schedule->getId(), 'resourceId' => $schedule->getAttribute('resourceId'), 'schedule' => $schedule->getAttribute('schedule'), 'resourceUpdatedAt' => $schedule->getAttribute('resourceUpdatedAt'), diff --git a/src/Appwrite/Platform/Tasks/ScheduleMessages.php b/src/Appwrite/Platform/Tasks/ScheduleMessages.php index 9ede91279d..ee11578fea 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleMessages.php +++ b/src/Appwrite/Platform/Tasks/ScheduleMessages.php @@ -50,6 +50,14 @@ class ScheduleMessages extends ScheduleBase ->setProject($schedule['project']) ->trigger(); + $dbForConsole->updateDocument( + 'schedules', + $schedule['$id'], + $dbForConsole + ->getDocument('schedules', $schedule['$id']) + ->setAttribute('active', false) + ); + $queueForDeletes ->setType(DELETE_TYPE_SCHEDULES) ->setDocument($schedule) diff --git a/src/Appwrite/Platform/Workers/Messaging.php b/src/Appwrite/Platform/Workers/Messaging.php index d57e1837d7..9b7bda57bb 100644 --- a/src/Appwrite/Platform/Workers/Messaging.php +++ b/src/Appwrite/Platform/Workers/Messaging.php @@ -134,7 +134,7 @@ class Messaging extends Action Query::equal('type', [$recipients[0]->getAttribute('providerType')]), ]); - if ($fallback === false) { + if ($fallback === false || $fallback->isEmpty()) { Console::error('No fallback provider found.'); return; }