Skip to content

Commit 1ee39cd

Browse files
committed
MAGE-848 Delete all old replica configurations before resyncing via patch
1 parent 08c57fb commit 1ee39cd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Setup/Patch/Data/RebuildReplicasPatch.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,11 @@ public function apply(): PatchInterface
4848
$this->state->setAreaCode(\Magento\Framework\App\Area::AREA_ADMINHTML);
4949

5050
$storeIds = array_keys($this->storeManager->getStores());
51+
// Delete all replicas before resyncing in case of incorrect replica assignments
5152
foreach ($storeIds as $storeId) {
5253
$this->replicaManager->deleteReplicasFromAlgolia($storeId);
54+
}
55+
foreach ($storeIds as $storeId) {
5356
$this->replicaManager->syncReplicasToAlgolia($storeId, $this->productHelper->getIndexSettings($storeId));
5457
}
5558

0 commit comments

Comments
 (0)