mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
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\Cli\Command;
|
||||||
use Icinga\Module\Director\Job\JobRunner;
|
use Icinga\Module\Director\Job\JobRunner;
|
||||||
|
use Icinga\Module\Director\Objects\DirectorJob;
|
||||||
use Icinga\Module\Director\Objects\ImportSource;
|
use Icinga\Module\Director\Objects\ImportSource;
|
||||||
use Icinga\Module\Director\Objects\SyncRule;
|
use Icinga\Module\Director\Objects\SyncRule;
|
||||||
use Icinga\Module\Director\IcingaConfig\IcingaConfig;
|
use Icinga\Module\Director\IcingaConfig\IcingaConfig;
|
||||||
@ -18,10 +19,11 @@ class JobsCommand extends Command
|
|||||||
public function runAction()
|
public function runAction()
|
||||||
{
|
{
|
||||||
$forever = $this->params->shift('forever');
|
$forever = $this->params->shift('forever');
|
||||||
$job = $this->params->shift();
|
$jobId = $this->params->shift();
|
||||||
if ($job) {
|
if ($jobId) {
|
||||||
echo "Running (theoretically) $job\n";
|
$job = DirectorJob::load($jobId, $this->db());
|
||||||
return;
|
$job->run();
|
||||||
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($forever) {
|
if ($forever) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user