BUGFIX: I don't eat brains

This commit is contained in:
Jeroen De Meerleer 2021-05-26 01:22:36 +02:00
parent 4dd743c732
commit 9ab63f7de1
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
1 changed files with 4 additions and 2 deletions

View File

@ -50,7 +50,9 @@ class DaemonCommand extends Command
foreach($jobsToRun as $job) { foreach($jobsToRun as $job) {
$jobRepo->setJobRunning($job, true); $jobRepo->setJobRunning($job, true);
$output->writeln('Runnig Job ' . $job); $output->writeln('Runnig Job ' . $job);
$pid = pcntl_fork(); declare(ticks = 1);
pcntl_signal(SIGCHLD, SIG_IGN);
$pid = pcntl_fork();
if($pid == -1) { if($pid == -1) {
$jobRepo->RunJob($job); $jobRepo->RunJob($job);
$jobRepo->setJobRunning($job, false); $jobRepo->setJobRunning($job, false);
@ -70,4 +72,4 @@ class DaemonCommand extends Command
$output->writeln('Ended after ' . $timelimit . ' seconds'); $output->writeln('Ended after ' . $timelimit . ' seconds');
return Command::SUCCESS; return Command::SUCCESS;
} }
} }