BUGFIX: reboot jobs stopped after triggering initial command
This commit is contained in:
parent
c59a84a34f
commit
12205ad18e
|
@ -74,13 +74,10 @@ class DaemonCommand extends Command
|
||||||
$jobRepo = $this->doctrine->getRepository(Job::class);
|
$jobRepo = $this->doctrine->getRepository(Job::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$async || $pid == -1) {
|
if((!$async || $pid == -1) || $pid == 0) {
|
||||||
$jobRepo->RunJob($job, $manual);
|
$result = $jobRepo->RunJob($job, $manual);
|
||||||
$jobRepo->setJobRunning($job, false);
|
if ($result['status'] == 'ran') $jobRepo->setJobRunning($job, false);
|
||||||
} elseif ($pid == 0) {
|
if ($pid == 0) exit;
|
||||||
$jobRepo->RunJob($job, $manual);
|
|
||||||
$jobRepo->setJobRunning($job, false);
|
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
unset($jobsToRun[$key]);
|
unset($jobsToRun[$key]);
|
||||||
unset($job);
|
unset($job);
|
||||||
|
|
|
@ -516,7 +516,7 @@ class JobRepository extends EntityRepository
|
||||||
$this->deleteTempVar($job);
|
$this->deleteTempVar($job);
|
||||||
$em->persist($job);
|
$em->persist($job);
|
||||||
$em->flush();
|
$em->flush();
|
||||||
return ['job_id' => $job->getId(), 'exitcode' => $result['exitcode'], 'timestamp' =>floor($starttime), 'runtime' => $runtime, 'output' => (string)$result['output'], 'flags' => implode("", $flags)];
|
return ['job_id' => $job->getId(), 'status' => 'ran', 'exitcode' => $result['exitcode'], 'timestamp' =>floor($starttime), 'runtime' => $runtime, 'output' => (string)$result['output'], 'flags' => implode("", $flags)];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue