Exemple #1
0
 protected function initialize()
 {
     parent::initialize();
     $helper = $this->getHelper('Module\\Cron');
     if ($helper->isRunnerService()) {
         $helper->isLastAccessMoreThan(\Ess\M2ePro\Helper\Module\Cron::RUNNER_SERVICE_MAX_INACTIVE_TIME) && $this->resetTasksStartFrom();
         return;
     }
     $helper->setRunner(\Ess\M2ePro\Helper\Module\Cron::RUNNER_SERVICE);
     $helper->setLastRunnerChange($this->getHelper('Data')->getCurrentGmtDate());
     $this->resetTasksStartFrom();
 }
Exemple #2
0
 protected function initialize()
 {
     usleep(rand(0, 2000000));
     parent::initialize();
     $helper = $this->getHelper('Module\\Cron');
     if ($helper->isRunnerMagento()) {
         return;
     }
     if ($helper->isLastRunMoreThan(\Ess\M2ePro\Helper\Module\Cron::RUNNER_SERVICE_MAX_INACTIVE_TIME)) {
         $helper->setRunner(\Ess\M2ePro\Helper\Module\Cron::RUNNER_MAGENTO);
         $helper->setLastRunnerChange($this->getHelper('Data')->getCurrentGmtDate());
     }
 }