Exemplo n.º 1
0
 /**
  * Finalize step
  *
  * @return void
  */
 protected function finalizeStep()
 {
     parent::finalizeStep();
     $this->release();
     $this->model->setTriggerTime(\XLite\Core\Converter::time() + $this->getPeriod());
 }
Exemplo n.º 2
0
 /**
  * Finalize step
  *
  * @return void
  */
 protected function finalizeStep()
 {
     parent::finalizeStep();
     $this->model->setTriggerTime(time() + $this->getPeriod());
 }
Exemplo n.º 3
0
Arquivo: Cron.php Projeto: kingsj/core
 /**
  * Run runner 
  * 
  * @param \XLite\Core\Task\ATask $runner Runner
  *  
  * @return void
  */
 protected function runRunner(\XLite\Core\Task\ATask $runner)
 {
     $silence = !$runner->getTitle();
     if ($runner && $runner->isReady()) {
         if (!$silence) {
             $this->printContent($runner->getTitle() . ' ... ');
         }
         $runner->run();
         if (!$silence) {
             $this->printContent($runner->getMessage() ?: 'done');
         }
     }
     if (!$silence) {
         $this->printContent(PHP_EOL);
     }
     \XLite\Core\Database::getEM()->flush();
 }
Exemplo n.º 4
0
 /**
  * Run runner 
  * 
  * @param \XLite\Core\Task\ATask $runner Runner
  *  
  * @return void
  */
 protected function runRunner(\XLite\Core\Task\ATask $runner)
 {
     $silence = !$runner->getTitle();
     if ($runner && $runner->isReady() && !$runner->isRunning()) {
         if (!$silence) {
             $this->printContent($runner->getTitle() . ' ... ');
         }
         $runner->run();
         if (!$silence) {
             $this->printContent($runner->getMessage() ?: 'done');
         }
     } elseif ($runner->isRunning()) {
         $msg = !$runner->shouldRunIfCrashed() ? '| Task will not be restarted because previous attempt has failed. Remove lock files manually to start the task' : '';
         $this->printContent($runner->getTitle() . ' ... Already running ' . $msg);
     }
     if (!$silence) {
         $this->printContent(PHP_EOL);
     }
     \XLite\Core\Database::getEM()->flush();
 }