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'])