Skip to content

Commit 0779428

Browse files
committed
MC-38168: Manual Indexer after Merchandising - Empty Catalog/ Number of products incorrect
1 parent 78b353e commit 0779428

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

app/code/Magento/Indexer/Model/Processor.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,18 @@ public function reindexAllInvalid()
8585
// Skip indexers having shared index that was already complete
8686
$sharedIndex = $indexerConfig['shared_index'] ?? null;
8787
if (!in_array($sharedIndex, $this->sharedIndexesComplete)) {
88+
if (!empty($sharedIndex)) {
89+
$sharedIndexer = $this->indexerFactory->create()->load($sharedIndex);
90+
if ($sharedIndexer->getView()->isEnabled()) {
91+
$sharedIndexer->getView()->suspend();
92+
}
93+
}
8894
$indexer->reindexAll();
95+
if (!empty($sharedIndex)) {
96+
if ($sharedIndexer->getView()->isEnabled()) {
97+
$sharedIndexer->getView()->resume();
98+
}
99+
}
89100

90101
if (!empty($sharedIndex) && $this->makeSharedValid->execute($sharedIndex)) {
91102
$this->sharedIndexesComplete[] = $sharedIndex;

0 commit comments

Comments
 (0)