JobsCommand: really run also single jobs
This commit is contained in:
parent
4494af559f
commit
a078efd032
|
@ -4,6 +4,7 @@ namespace Icinga\Module\Director\Clicommands;
|
|||
|
||||
use Icinga\Module\Director\Cli\Command;
|
||||
use Icinga\Module\Director\Job\JobRunner;
|
||||
use Icinga\Module\Director\Objects\DirectorJob;
|
||||
use Icinga\Module\Director\Objects\ImportSource;
|
||||
use Icinga\Module\Director\Objects\SyncRule;
|
||||
use Icinga\Module\Director\IcingaConfig\IcingaConfig;
|
||||
|
@ -18,10 +19,11 @@ class JobsCommand extends Command
|
|||
public function runAction()
|
||||
{
|
||||
$forever = $this->params->shift('forever');
|
||||
$job = $this->params->shift();
|
||||
if ($job) {
|
||||
echo "Running (theoretically) $job\n";
|
||||
return;
|
||||
$jobId = $this->params->shift();
|
||||
if ($jobId) {
|
||||
$job = DirectorJob::load($jobId, $this->db());
|
||||
$job->run();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
if ($forever) {
|
||||
|
|
Loading…
Reference in New Issue