Exemple #1
0
 /**
  * @param Job $job
  * @param CronEvent $event
  * @return AbstractEvent
  */
 private function handleCronEvent(Job $job, CronEvent $event) : AbstractEvent
 {
     if (!$event->isPropagationStopped()) {
         $nextRun = $this->cron->getNextRun($event->getExpression());
         $job->setTimestamp($nextRun);
         $this->gateway->addJob($job);
     }
     return $event->getEvent();
 }
Exemple #2
0
 /**
  * @param CronEvent $event
  */
 public function onCronEvent(CronEvent $event)
 {
     $cron = CronExpression::factory($event->getExpression());
     $this->gateway->addEvent($event, $cron->getNextRunDate()->getTimestamp());
 }