BUGFIX: We need to sleep at least 1 second or we get doubles

This commit is contained in:
Jeroen De Meerleer 2022-09-26 14:16:35 +02:00
parent 159ec33a22
commit 3a95d23d8b
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
1 changed files with 1 additions and 1 deletions

View File

@ -89,7 +89,7 @@ class DaemonCommand extends Command
file_put_contents($this->kernel->getCacheDir() . '/daemon-running.lock', time()); file_put_contents($this->kernel->getCacheDir() . '/daemon-running.lock', time());
$maxwait = time() + 30; $maxwait = time() + 30;
$nextrun = $jobRepo->getTimeOfNextRun(); $nextrun = max($jobRepo->getTimeOfNextRun(), time() + 1);
$sleepuntil = min($maxwait, $nextrun); $sleepuntil = min($maxwait, $nextrun);
if($sleepuntil > time()) time_sleep_until($sleepuntil); if($sleepuntil > time()) time_sleep_until($sleepuntil);
} }