From 83243800b55c1e1dae886f67f569c839dcb68306 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 6 Jun 2018 05:26:22 +0000 Subject: [PATCH 1/2] Ensure that cron workers are called even at busy times --- bin/daemon.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/daemon.php b/bin/daemon.php index 185e0671a..2069c13ea 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -127,11 +127,21 @@ file_put_contents($pidfile, $pid); $wait_interval = intval(Config::get('system', 'cron_interval', 5)) * 60; $do_cron = true; +$last_cron = 0; // Now running as a daemon. while (true) { + if (!$do_cron && ($last_cron + $wait_interval) < time()) { + logger('Forcing cron worker call.'); + $do_cron = true; + } + Worker::spawnWorker($do_cron); + if ($do_cron) { + $last_cron = time(); + } + logger("Sleeping", LOGGER_DEBUG); $i = 0; do { From e005312b87b405959ea007b840a78eb5c4dbf55b Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 6 Jun 2018 05:32:06 +0000 Subject: [PATCH 2/2] Should be just a debug log entry --- bin/daemon.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/daemon.php b/bin/daemon.php index 2069c13ea..a92446c65 100755 --- a/bin/daemon.php +++ b/bin/daemon.php @@ -132,7 +132,7 @@ $last_cron = 0; // Now running as a daemon. while (true) { if (!$do_cron && ($last_cron + $wait_interval) < time()) { - logger('Forcing cron worker call.'); + logger('Forcing cron worker call.', LOGGER_DEBUG); $do_cron = true; }