@@ -133,12 +133,14 @@ protected function clearAlgoliaReplicaSettingCache($primaryIndexName = null): vo
133
133
* relevant to the Magento integration
134
134
*
135
135
* @param string $primaryIndexName
136
+ * @param bool $refreshCache
136
137
* @return string[] Array of replica index names
137
138
* @throws LocalizedException
139
+ * @throws NoSuchEntityException
138
140
*/
139
- protected function getMagentoReplicaConfigurationFromAlgolia (string $ primaryIndexName ): array
141
+ protected function getMagentoReplicaConfigurationFromAlgolia (string $ primaryIndexName, bool $ refreshCache = false ): array
140
142
{
141
- $ algoliaReplicas = $ this ->getReplicaConfigurationFromAlgolia ($ primaryIndexName );
143
+ $ algoliaReplicas = $ this ->getReplicaConfigurationFromAlgolia ($ primaryIndexName, $ refreshCache );
142
144
$ magentoReplicas = $ this ->getMagentoReplicaSettings ($ primaryIndexName , $ algoliaReplicas );
143
145
return array_values (array_intersect ($ magentoReplicas , $ algoliaReplicas ));
144
146
}
@@ -241,7 +243,7 @@ protected function setReplicasOnPrimaryIndex(int $storeId): array
241
243
$ indexName = $ this ->indexNameFetcher ->getProductIndexName ($ storeId );
242
244
$ sortingIndices = $ this ->sortingTransformer ->getSortingIndices ($ storeId );
243
245
$ newMagentoReplicasSetting = $ this ->sortingTransformer ->transformSortingIndicesToReplicaSetting ($ sortingIndices );
244
- $ oldMagentoReplicasSetting = $ this ->getMagentoReplicaConfigurationFromAlgolia ($ indexName );
246
+ $ oldMagentoReplicasSetting = $ this ->getMagentoReplicaConfigurationFromAlgolia ($ indexName, true );
245
247
$ nonMagentoReplicasSetting = $ this ->getNonMagentoReplicaConfigurationFromAlgolia ($ indexName );
246
248
$ oldMagentoReplicaIndices = $ this ->getBareIndexNamesFromReplicaSetting ($ oldMagentoReplicasSetting );
247
249
$ newMagentoReplicaIndices = $ this ->getBareIndexNamesFromReplicaSetting ($ newMagentoReplicasSetting );
0 commit comments