Beispiel #1
0
 protected function initialize()
 {
     parent::initialize();
     usleep(rand(0, 2000000));
     $helper = Mage::helper('M2ePro/Module_Cron');
     $maxServiceInactiveTime = Ess_M2ePro_Model_Cron_Type_Service::MAX_INACTIVE_TIME;
     if (!$helper->isTypeMagento() && $helper->isLastRunMoreThan($maxServiceInactiveTime)) {
         $helper->setType(Ess_M2ePro_Helper_Module_Cron::TYPE_MAGENTO);
     }
 }
Beispiel #2
0
 protected function initialize()
 {
     usleep(rand(0, 2000000));
     parent::initialize();
     $helper = Mage::helper('M2ePro/Module_Cron');
     $maxServiceInactiveTime = Ess_M2ePro_Model_Cron_Type_Service::MAX_INACTIVE_TIME;
     if (!$helper->isTypeMagento() && $helper->isLastRunMoreThan($maxServiceInactiveTime) && !$this->getLockItem()->isExist()) {
         $helper->setType(Ess_M2ePro_Helper_Module_Cron::TYPE_MAGENTO);
         $helper->setLastTypeChange(Mage::helper('M2ePro')->getCurrentGmtDate());
     }
 }
Beispiel #3
0
 protected function initialize()
 {
     parent::initialize();
     $helper = Mage::helper('M2ePro/Module_Cron');
     if (!$helper->isTypeService()) {
         $helper->setType(Ess_M2ePro_Helper_Module_Cron::TYPE_SERVICE);
         $helper->setLastTypeChange(Mage::helper('M2ePro')->getCurrentGmtDate());
         $this->resetTasksStartFrom();
     } else {
         $helper->isLastAccessMoreThan(self::MAX_INACTIVE_TIME) && $this->resetTasksStartFrom();
     }
 }
Beispiel #4
0
 protected function initialize()
 {
     parent::initialize();
     if ($this->isDisabledByDeveloper()) {
         return;
     }
     $helper = Mage::helper('M2ePro/Module_Cron');
     if (!$helper->isTypeService() || $helper->isLastAccessMoreThan(self::MAX_INACTIVE_TIME)) {
         if (!$helper->isTypeService()) {
             $helper->setType(Ess_M2ePro_Helper_Module_Cron::TYPE_SERVICE);
         }
         $this->resetTasksStartFrom();
     }
     if (is_null($this->getAuthKey())) {
         Mage::getModel('M2ePro/Servicing_Dispatcher')->processTask(Mage::getModel('M2ePro/Servicing_Task_Cron')->getPublicNick());
     }
 }