Skip to content

Commit 8d722c8

Browse files
authored
Merge pull request #14 from springbot/SB2-13746
Area Code BugFix SB2-15225
2 parents fc7a83b + fbc9486 commit 8d722c8

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Console/Command/ProcessQueueCommand.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ public function __construct(State $state, Queue $queue)
2727
$this->_state = $state;
2828
$this->_queue = $queue;
2929

30-
$state->setAreaCode('adminhtml');
31-
3230
parent::__construct();
3331
}
3432

@@ -49,7 +47,14 @@ protected function configure()
4947
*/
5048
protected function execute(InputInterface $input, OutputInterface $output)
5149
{
50+
try {
51+
$this->_state->getAreaCode();
52+
} catch (\Throwable $e) {
53+
$this->_state->setAreaCode(\Magento\Framework\App\Area::AREA_ADMINHTML);
54+
}
55+
5256
$success = $this->_queue->runNextJob();
57+
5358
if ($success === true) {
5459
$output->writeln("Queue Processed.");
5560
} elseif ($success === false) {

etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
5-
<module name="Springbot_Queue" setup_version="1.2.1"/>
5+
<module name="Springbot_Queue" setup_version="1.2.2"/>
66
</config>

0 commit comments

Comments
 (0)