Skip to content

Commit afb339d

Browse files
author
Ivan Gavryshko
committed
MAGETWO-37728: Skip-reindex param/feature was lost in generator
- fixed, skip-reindex option added
1 parent 649b03a commit afb339d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

setup/src/Magento/Setup/Console/Command/GenerateFixturesCommand.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
use Symfony\Component\Console\Command\Command;
1010
use Symfony\Component\Console\Input\InputArgument;
11+
use Symfony\Component\Console\Input\InputOption;
1112
use Symfony\Component\Console\Input\InputInterface;
1213
use Symfony\Component\Console\Output\OutputInterface;
1314
use Magento\Setup\Fixtures\FixtureModel;
@@ -22,6 +23,8 @@ class GenerateFixturesCommand extends Command
2223
*/
2324
const PROFILE_ARGUMENT = 'profile';
2425

26+
const SKIP_REINDEX_OPTION = 'skip-reindex';
27+
2528
/**
2629
* @var FixtureModel
2730
*/
@@ -49,6 +52,12 @@ protected function configure()
4952
InputArgument::REQUIRED,
5053
'Path to profile configuration file'
5154
),
55+
new InputOption(
56+
self::SKIP_REINDEX_OPTION,
57+
's',
58+
InputOption::VALUE_NONE,
59+
'Skip reindex'
60+
)
5261
]);
5362
parent::configure();
5463
}
@@ -99,7 +108,10 @@ protected function execute(InputInterface $input, OutputInterface $output)
99108
$indexer->setScheduled($indexersState[$indexerId['indexer_id']]);
100109
}
101110

102-
$fixtureModel->reindex($output);
111+
if (!$input->getOption(self::SKIP_REINDEX_OPTION)) {
112+
$fixtureModel->reindex($output);
113+
}
114+
103115
$totalEndTime = microtime(true);
104116
$totalResultTime = $totalEndTime - $totalStartTime;
105117

0 commit comments

Comments
 (0)