Unclaim on end / don't refetch

2022.09-rc
Michael 2020-08-29 11:26:40 +00:00
rodzic 069786cd7f
commit 8148d9dc9d
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -96,7 +96,8 @@ class Worker
// We fetch the next queue entry that is about to be executed
while ($r = self::workerProcess()) {
$refetched = false;
// Don't refetch when a worker fetches tasks for multiple workers
$refetched = DI::config()->get('system', 'worker_multiple_fetch');
foreach ($r as $entry) {
// Assure that the priority is an integer value
$entry['priority'] = (int)$entry['priority'];
@ -143,6 +144,7 @@ class Worker
// Quit the worker once every cron interval
if (time() > ($starttime + (DI::config()->get('system', 'cron_interval') * 60))) {
Logger::info('Process lifetime reached, respawning.');
self::unclaimProcess();
self::spawnWorker();
return;
}