JobRunner: adjust method signatures
This commit is contained in:
parent
fe8c4bc6a3
commit
c6eab9c75f
|
@ -3,6 +3,7 @@
|
||||||
namespace Icinga\Module\Director\Job;
|
namespace Icinga\Module\Director\Job;
|
||||||
|
|
||||||
use Icinga\Module\Director\Db;
|
use Icinga\Module\Director\Db;
|
||||||
|
use Icinga\Module\Director\Objects\DirectorJob;
|
||||||
|
|
||||||
class JobRunner
|
class JobRunner
|
||||||
{
|
{
|
||||||
|
@ -20,7 +21,7 @@ class JobRunner
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function run(Job $job)
|
protected function run(DirectorJob $job)
|
||||||
{
|
{
|
||||||
if ($this->shouldFork()) {
|
if ($this->shouldFork()) {
|
||||||
$this->fork($job);
|
$this->fork($job);
|
||||||
|
@ -29,7 +30,7 @@ class JobRunner
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function fork(Job $job)
|
protected function fork(DirectorJob $job)
|
||||||
{
|
{
|
||||||
$cmd = 'icingacli director job run ' . $job->id;
|
$cmd = 'icingacli director job run ' . $job->id;
|
||||||
$output = `$cmd`;
|
$output = `$cmd`;
|
||||||
|
@ -37,10 +38,12 @@ class JobRunner
|
||||||
|
|
||||||
protected function shouldFork()
|
protected function shouldFork()
|
||||||
{
|
{
|
||||||
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getRegisteredJobs()
|
protected function getConfiguredJobs()
|
||||||
{
|
{
|
||||||
|
return DirectorJob::loadAll($this->db);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue