Unclaim on end / don't refetch

This commit is contained in:
Michael 2020-08-29 11:26:40 +00:00
parent 069786cd7f
commit 8148d9dc9d

View file

@ -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;
}