Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function scheduleNext(SchedulerInterface $scheduler)
 {
     $now = new \DateTime();
     $executionDate = $now->modify('+1 day');
     if (null !== $this->end && $executionDate > $this->end) {
         return;
     }
     $scheduler->createTask($this->getTaskName(), $this->getWorkload())->daily($this->start, $this->end)->setExecutionDate($executionDate)->schedule();
 }
 /**
  * Called by event: ContentEvents::NODE_POST_SAVE
  */
 public function onSave(ContentNodeEvent $event)
 {
     $this->scheduler->createTask('sulu_task.warmup_page', ['uuid' => $event->getNode()->getIdentifier(), 'locale' => $event->getStructure()->getLanguageCode(), 'webspaceKey' => $event->getStructure()->getWebspaceKey()])->schedule();
 }
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->scheduler->createTask($input->getArgument('handler'), $input->getArgument('workload'))->schedule();
 }