Skip to content

Commit 59548d6

Browse files
[NS-793] indexer:reindex --with-dependencies - Removed interaction
1 parent c3350cf commit 59548d6

File tree

1 file changed

+10
-26
lines changed

1 file changed

+10
-26
lines changed

Patch-Magento_Indexer-M2.3.1-indexer-reindex-optional-dependencies.patch

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
--- Console/Command/IndexerReindexCommand.php.origin 2020-01-10 06:20:40.000000000 +0300
2-
+++ Console/Command/IndexerReindexCommand.php 2020-04-20 17:52:02.188753742 +0300
1+
--- Console/Command/IndexerReindexCommand.php
2+
+++ Console/Command/IndexerReindexCommand.php
33
@@ -22,6 +22,8 @@
44
*/
55
class IndexerReindexCommand extends AbstractIndexerManageCommand
@@ -9,51 +9,35 @@
99
/**
1010
* @var array
1111
*/
12-
@@ -66,6 +68,14 @@
12+
@@ -66,6 +68,13 @@
1313
->setDescription('Reindexes Data')
1414
->setDefinition($this->getInputList());
1515

1616
+ $this->addOption(
1717
+ static::INPUT_OPTION_WITH_DEPENDENCIES,
1818
+ null,
19-
+ \Symfony\Component\Console\Input\InputArgument::OPTIONAL,
20-
+ 'Reindex also dependent and related indexers (default Magento 2 behavior)',
21-
+ false
19+
+ \Symfony\Component\Console\Input\InputOption::VALUE_NONE,
20+
+ 'Reindex also dependent and related indexers (default Magento 2 behavior)'
2221
+ );
2322
+
2423
parent::configure();
2524
}
2625

27-
@@ -74,6 +84,28 @@
26+
@@ -74,6 +83,13 @@
2827
*/
2928
protected function execute(InputInterface $input, OutputInterface $output)
3029
{
3130
+ $withDependencies = $this->isWithDependencies($input);
3231
+
3332
+ if (!$withDependencies) {
34-
+ $output->writeln('<warning>You are going to run reindex without dependencies.</warning>');
35-
+ $output->writeln('<warning>Dependent and related indexers will be skipped.</warning>');
36-
+ $output->writeln('Use <info>--with-dependencies=1</info> to reindex with dependent and related indexers.');
37-
+
38-
+ /** @var \Symfony\Component\Console\Helper\QuestionHelper $questionHelper */
39-
+ $questionHelper = $this->getHelper('question');
40-
+
41-
+ $answer = $questionHelper->ask($input, $output, new \Symfony\Component\Console\Question\Question(
42-
+ "Continue? [yes/<info>no</info>] > ",
43-
+ 'no'
44-
+ ));
45-
+
46-
+ if (strpos($answer, 'y') !== 0) {
47-
+ $output->writeln('Skipped.');
48-
+
49-
+ return \Magento\Framework\Console\Cli::RETURN_FAILURE;
50-
+ }
33+
+ $output->writeln('<info>Dependent and related indexers will be ingored.</info>');
34+
+ $output->writeln('Use <info>--with-dependencies</info> to reindex with dependent and related indexers.');
5135
+ }
5236
+
5337
$returnValue = Cli::RETURN_FAILURE;
5438
foreach ($this->getIndexers($input) as $indexer) {
5539
try {
56-
@@ -119,15 +151,19 @@
40+
@@ -119,15 +135,19 @@
5741

5842
$relatedIndexers = [];
5943
$dependentIndexers = [];
@@ -82,7 +66,7 @@
8266
}
8367

8468
$invalidRelatedIndexers = [];
85-
@@ -300,4 +336,15 @@
69+
@@ -300,4 +320,15 @@
8670
}
8771
return $this->dependencyInfoProvider;
8872
}

0 commit comments

Comments
 (0)