JobRunner: adjust method signatures

This commit is contained in:
Thomas Gelf 2016-05-25 11:48:00 +02:00
parent fe8c4bc6a3
commit c6eab9c75f
1 changed files with 6 additions and 3 deletions

View File

@ -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);
} }
} }