From 9ab9f6d709ae6615ac6657e93f06fd0ede2977a3 Mon Sep 17 00:00:00 2001 From: Chirag Aggarwal Date: Tue, 23 Dec 2025 14:47:26 +0530 Subject: [PATCH] chore: update schedule functions task --- src/Appwrite/Platform/Tasks/ScheduleFunctions.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php index 7fda2f75df..396eeb373b 100644 --- a/src/Appwrite/Platform/Tasks/ScheduleFunctions.php +++ b/src/Appwrite/Platform/Tasks/ScheduleFunctions.php @@ -19,7 +19,7 @@ class ScheduleFunctions extends ScheduleBase public const UPDATE_TIMER = 10; // seconds public const ENQUEUE_TIMER = 60; // seconds - private ?float $lastEnqueueUpdate = null; + protected ?float $lastEnqueueUpdate = null; public static function getName(): string { @@ -36,6 +36,11 @@ class ScheduleFunctions extends ScheduleBase return RESOURCE_TYPE_FUNCTIONS; } + protected function getQueueForFunctions(): Func + { + return new Func($this->publisherFunctions); + } + protected function enqueueResources(Database $dbForPlatform, callable $getProjectDB): void { $timerStart = \microtime(true); @@ -95,8 +100,7 @@ class ScheduleFunctions extends ScheduleBase $this->updateProjectAccess($schedule['project'], $dbForPlatform); - $queueForFunctions = new Func($this->publisherFunctions); - + $queueForFunctions = $this->getQueueForFunctions(); $queueForFunctions ->setType('schedule') ->setFunction($schedule['resource'])