Example #1
0
 public static function getNextJob()
 {
     $broker = Broker::getInstance();
     $jobInfo = $broker->get();
     if (file_exists($jobInfo['path'])) {
         require_once $jobInfo['path'];
     }
     if (!class_exists($jobInfo['class'])) {
         Logger::error("Class {$jobInfo['class']} for scheduled job not found");
         return false;
     }
     $job = unserialize($jobInfo['object']);
     if (is_object($job) && is_a($job, '\\ajumamoro\\Job')) {
         $job->setId($jobInfo['id']);
         return $job;
     } else {
         Logger::error("Scheduled job is not of type \\ajumamoro\\Job.");
         return false;
     }
 }
Example #2
0
 public function getJobStatus($query)
 {
     return Broker::getInstance()->getStatus($query);
 }