/** * Finalize step * * @return void */ protected function finalizeStep() { parent::finalizeStep(); $this->release(); $this->model->setTriggerTime(\XLite\Core\Converter::time() + $this->getPeriod()); }
/** * Finalize step * * @return void */ protected function finalizeStep() { parent::finalizeStep(); $this->model->setTriggerTime(time() + $this->getPeriod()); }
/** * 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(); }
/** * 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(); }