1
0
Fork 0
mirror of synced 2024-10-01 01:37:56 +13:00

Fix function schedules

This commit is contained in:
Jake Barnby 2024-01-11 19:32:24 +13:00
parent 62304f817d
commit 449e8cc06c
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -23,7 +23,7 @@ class ScheduleFunctions extends ScheduleBase
public static function getSupportedResource(): string
{
return 'message';
return 'function';
}
protected function enqueueResources(Group $pools, Database $dbForConsole): void
@ -73,11 +73,11 @@ class ScheduleFunctions extends ScheduleBase
foreach ($scheduleKeys as $scheduleKey) {
// Ensure schedule was not deleted
if (!isset($schedules[$scheduleKey])) {
if (!\array_key_exists($scheduleKey, $this->schedules)) {
return;
}
$schedule = $schedules[$scheduleKey];
$schedule = $this->schedules[$scheduleKey];
$queueForFunctions = new Func($connection);
@ -95,7 +95,10 @@ class ScheduleFunctions extends ScheduleBase
}
$timerEnd = \microtime(true);
$this->lastEnqueueUpdate = $timerStart;
// TODO: This was a bug before because it wasn't passed by reference, enabling it breaks scheduling
//$this->lastEnqueueUpdate = $timerStart;
Console::log("Enqueue tick: {$total} executions were enqueued in " . ($timerEnd - $timerStart) . " seconds");
}
}