Adding a cooldown phase for the daemon
This commit is contained in:
parent
5c3d077dfb
commit
98dd15ec9a
2 changed files with 45 additions and 23 deletions
|
@ -185,7 +185,12 @@ while (true) {
|
|||
$do_cron = true;
|
||||
}
|
||||
|
||||
Worker::spawnWorker($do_cron);
|
||||
if ($do_cron || (!DI::process()->isMaxLoadReached() && Worker::entriesExists() && Worker::isReady())) {
|
||||
Worker::spawnWorker($do_cron);
|
||||
} else {
|
||||
Logger::info('Cool down', ['pid' => $pid]);
|
||||
sleep(10);
|
||||
}
|
||||
|
||||
if ($do_cron) {
|
||||
// We force a reconnect of the database connection.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue