Exemple #1
0
 /**
  * @return bool
  */
 public function isRunning()
 {
     $isRunning = false;
     foreach ($this->jobs as $id => $job) {
         if ($job->isRunning()) {
             $isRunning = true;
         } else {
             if (isset($this->processedJobs[$id])) {
                 continue;
             }
             $event = new JobEndedEvent();
             $event->setTarget($this);
             $event->setJob($job);
             $event->setReport($job->getReport());
             $this->getEventManager()->trigger($event);
             $this->processedJobs[$id] = true;
         }
     }
     return $isRunning;
 }
Exemple #2
0
 public function __invoke(JobEndedEvent $e)
 {
     $report = $e->getReport();
     $this->logger->log($e->getJob()->getId(), $report->getStartTime(), $report->getEndTime(), $report->isSuccessful(), $report->getOutput(), $report->getError());
 }