mirror of
https://github.com/friendica/friendica
synced 2024-12-22 18:00:16 +00:00
Ensure that cron workers are called even at busy times
This commit is contained in:
parent
e1216e3a60
commit
83243800b5
1 changed files with 10 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue