Example #1
0
 protected function preDispatch(\Magento\Framework\App\RequestInterface $request)
 {
     parent::preDispatch($request);
     $blockerWizardNick = $this->getBlockerWizardNick();
     if ($blockerWizardNick !== false) {
         $this->_redirect('*/wizard_' . $blockerWizardNick);
         return;
     }
     $this->addNotificationMessages();
     if ($request->isGet() && !$request->isPost() && !$request->isXmlHttpRequest()) {
         if (empty($this->getCustomViewComponentHelper()->getEnabledComponents())) {
             throw new \Ess\M2ePro\Model\Exception('At least 1 channel of current View should be enabled.');
         }
         try {
             $this->getHelper('Client')->updateBackupConnectionData(false);
         } catch (\Exception $exception) {
         }
         try {
             /** @var Dispatcher $dispatcher */
             $dispatcher = $this->modelFactory->getObject('Servicing\\Dispatcher');
             $dispatcher->process(Dispatcher::DEFAULT_INTERVAL, $dispatcher->getFastTasks());
         } catch (\Exception $exception) {
         }
     }
     /** @var Maintenance\Developer $maintenanceHelper */
     $maintenanceHelper = $this->getHelper('Module\\Maintenance\\Developer');
     if ($maintenanceHelper->isEnabled()) {
         if ($maintenanceHelper->isOwner()) {
             $maintenanceHelper->prolongRestoreDate();
         } elseif ($maintenanceHelper->isExpired()) {
             $maintenanceHelper->disable();
         }
     }
 }
Example #2
0
 protected function preDispatch(\Magento\Framework\App\RequestInterface $request)
 {
     parent::preDispatch($request);
     if ($request->isGet() && !$request->isPost() && !$request->isXmlHttpRequest()) {
         $this->addDevelopmentNotification();
         $this->addMaintenanceNotification();
     }
 }