deploymentConfig = $deploymentConfig; $this->asyncConfigPublisher = $asyncConfigPublisher; $this->resultRedirectFactory = $resultRedirectFactory; $this->messageManager = $messageManager; } /** * Around Config save controller * * @param Save $subject * @param callable $proceed * @return \Magento\Backend\Model\View\Result\Redirect * @throws FileSystemException * @throws LocalizedException * @throws RuntimeException */ public function aroundExecute(Save $subject, callable $proceed) { if (!$this->deploymentConfig->get(ConfigOptionsList::CONFIG_PATH_ASYNC_CONFIG_SAVE)) { return $proceed(); } else { $configData = $subject->getConfigData(); $this->asyncConfigPublisher->saveConfigData($configData); $this->messageManager->addSuccessMessage(__('Configuration changes will be applied by consumer soon.')); $subject->_saveState($subject->getRequest()->getPost('config_state')); /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */ $resultRedirect = $this->resultRedirectFactory->create(); return $resultRedirect->setPath( 'adminhtml/system_config/edit', [ '_current' => ['section', 'website', 'store'], '_nosid' => true ] ); } } }