Skip to content

Commit e6f0044

Browse files
committed
MCP-957: Parallel Indexation for Catalog Permission
-Show command when indexer is disabled;
1 parent cb8696f commit e6f0044

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,26 @@ class IndexerShowDimensionsModeCommand extends AbstractIndexerCommand
3636
* @var string[]
3737
*/
3838
private $indexers;
39+
/**
40+
* @var string[]
41+
*/
42+
private $optionalIndexers;
3943

4044
/**
4145
* @param ObjectManagerFactory $objectManagerFactory
4246
* @param ScopeConfigInterface $configReader
4347
* @param array $indexers
48+
* @param array $optionalIndexers
4449
*/
4550
public function __construct(
4651
ObjectManagerFactory $objectManagerFactory,
4752
ScopeConfigInterface $configReader,
48-
array $indexers
53+
array $indexers,
54+
array $optionalIndexers
4955
) {
5056
$this->configReader = $configReader;
5157
$this->indexers = $indexers;
58+
$this->optionalIndexers = $optionalIndexers;
5259
parent::__construct($objectManagerFactory);
5360
}
5461

@@ -92,7 +99,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
9299
$output->writeln(sprintf('%-50s ', $indexer->getTitle() . ':') . $mode);
93100
}
94101
} catch (\Exception $e) {
95-
if ($e instanceof \InvalidArgumentException && $indexerId !== 'catalogpermissions_category') {
102+
if (!in_array($indexerId, $this->optionalIndexers)) {
96103
$output->writeln('"' . $indexer->getTitle() . '" indexer process unknown error:' . PHP_EOL);
97104
$output->writeln($e->getMessage() . PHP_EOL);
98105
// we must have an exit code higher than zero to indicate something was wrong
@@ -114,7 +121,7 @@ private function getInputList(): array
114121
$arguments[] = new InputArgument(
115122
self::INPUT_KEY_INDEXER,
116123
InputArgument::OPTIONAL | InputArgument::IS_ARRAY,
117-
$optionDescription . ' (' . implode($this->indexers) . ')'
124+
$optionDescription . ' (' . implode(',', $this->indexers) . ')'
118125
);
119126

120127
return $arguments;

0 commit comments

Comments
 (0)