20 foreach ($collectionsNames as $collectionName) {
21 $this->_objectManager->create($collectionName)->aggregate();
23 $this->messageManager->addSuccess(
__(
'You refreshed lifetime statistics.'));
24 }
catch (\
Magento\Framework\Exception\LocalizedException $e) {
25 $this->messageManager->addError($e->getMessage());
26 }
catch (\Exception $e) {
27 $this->messageManager->addError(
__(
'We can\'t refresh lifetime statistics.'));
28 $this->_objectManager->get(\Psr\Log\LoggerInterface::class)->critical($e);
31 if ($this->
_getSession()->isFirstPageAfterLogin()) {
_redirect($path, $arguments=[])