diff --git a/Model/Schedule.php b/Model/Schedule.php index a309453..2abc458 100644 --- a/Model/Schedule.php +++ b/Model/Schedule.php @@ -471,7 +471,10 @@ function setJobStatus($scheduleid,$status,$output) { * @return array */ function getJob($scheduleid) { - return $this->pendingjobs[$scheduleid]; + if (isset($this->pendingjobs[$scheduleid])) { + return $this->pendingjobs[$scheduleid]; + } + return NULL; } /** @@ -515,10 +518,12 @@ public function service() { if ($this->governor) { $job = $this->getJob($scheduleid); - $jobconfig = $this->getJobConfig($job["job_code"]); - if (isset($jobconfig["consumers"]) && $jobconfig["consumers"]) { - #run the consumers governor - $this->consumersGovenor($pid,$scheduleid); + if ($job) { + $jobconfig = $this->getJobConfig($job["job_code"]); + if (isset($jobconfig["consumers"]) && $jobconfig["consumers"]) { + #run the consumers governor + $this->consumersGovenor($pid, $scheduleid); + } } }