Skip to content

Commit 684fc7f

Browse files
committed
MCP-957: Parallel Indexation for Catalog Permission
1 parent a668273 commit 684fc7f

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

app/code/Magento/Indexer/Console/Command/IndexerShowDimensionsModeCommand.php

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Magento\Framework\App\ObjectManagerFactory;
1313
use Magento\Framework\App\Config\ScopeConfigInterface;
1414
use Magento\Framework\Console\Cli;
15-
use Magento\SharedCatalog\Model\State as SharedCatalogState;
1615
use Symfony\Component\Console\Input\InputArgument;
1716

1817
/**
@@ -37,27 +36,26 @@ class IndexerShowDimensionsModeCommand extends AbstractIndexerCommand
3736
* @var string[]
3837
*/
3938
private $indexers;
40-
4139
/**
42-
* @var SharedCatalogState
40+
* @var string[]
4341
*/
44-
private $sharedCatalogState;
42+
private $optionalIndexers;
4543

4644
/**
4745
* @param ObjectManagerFactory $objectManagerFactory
4846
* @param ScopeConfigInterface $configReader
49-
* @param SharedCatalogState $sharedCatalogState
5047
* @param array $indexers
48+
* @param array $optionalIndexers
5149
*/
5250
public function __construct(
5351
ObjectManagerFactory $objectManagerFactory,
5452
ScopeConfigInterface $configReader,
55-
SharedCatalogState $sharedCatalogState,
56-
array $indexers
53+
array $indexers,
54+
array $optionalIndexers
5755
) {
5856
$this->configReader = $configReader;
59-
$this->sharedCatalogState = $sharedCatalogState;
6057
$this->indexers = $indexers;
58+
$this->optionalIndexers = $optionalIndexers;
6159
parent::__construct($objectManagerFactory);
6260
}
6361

@@ -101,9 +99,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
10199
$output->writeln(sprintf('%-50s ', $indexer->getTitle() . ':') . $mode);
102100
}
103101
} catch (\Exception $e) {
104-
if ($indexerId === 'catalogpermissions_category' && !$this->sharedCatalogState->isGlobal()) {
105-
// do nothing
106-
} else {
102+
if (!in_array($indexerId, $this->optionalIndexers)) {
107103
$output->writeln('"' . $indexer->getTitle() . '" indexer process unknown error:' . PHP_EOL);
108104
$output->writeln($e->getMessage() . PHP_EOL);
109105
// we must have an exit code higher than zero to indicate something was wrong

0 commit comments

Comments
 (0)