From: Michael Date: Wed, 27 Feb 2019 07:08:44 +0000 (+0000) Subject: And moving the block back to the old place X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=11e39da6ccd4ff86be95de6af9e6f84ca67996d9;p=friendica.git And moving the block back to the old place --- diff --git a/src/Core/Worker.php b/src/Core/Worker.php index 362d41811c..1aa3391707 100644 --- a/src/Core/Worker.php +++ b/src/Core/Worker.php @@ -124,13 +124,6 @@ class Worker self::$state = self::STATE_LONG_LOOP; } - // Quit the worker once every cron interval - if (time() > ($starttime + Config::get('system', 'cron_interval'))) { - Logger::log('Process lifetime reached, respawning.', Logger::DEBUG); - self::spawnWorker(); - return; - } - // To avoid the quitting of multiple workers only one worker at a time will execute the check if (Lock::acquire('worker', 0)) { // Count active workers and compare them with a maximum value that depends on the load @@ -148,6 +141,13 @@ class Worker } Lock::release('worker'); } + + // Quit the worker once every cron interval + if (time() > ($starttime + Config::get('system', 'cron_interval'))) { + Logger::log('Process lifetime reached, respawning.', Logger::DEBUG); + self::spawnWorker(); + return; + } } // Cleaning up. Possibly not needed, but it doesn't harm anything.