Fix exit condition in DaemonCommand.php

The code change fixes the exit condition in the DaemonCommand.php file. Previously, the code would exit if `$pid` was equal to 0, but now it will only exit if `$pid` is set and equal to 0. This ensures that the correct condition is checked before exiting.
This commit is contained in:
Jeroen De Meerleer 2023-07-11 17:02:45 +02:00
parent 0d0b3b2e94
commit 7b899a01ef
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
1 changed files with 1 additions and 1 deletions

View File

@ -82,7 +82,7 @@ class DaemonCommand extends Command
if((!$async || $pid == -1) || $pid == 0) {
$result = $jobRepo->RunJob($job, $manual);
if ($result['status'] == 'ran') $jobRepo->setJobRunning($job, false);
if ($pid == 0) exit;
if (isset($pid) && $pid == 0) exit;
}
unset($jobsToRun[$key]);
unset($job);