Skip to content

Commit 71ad358

Browse files
Roman HaninRoman Hanin
authored andcommitted
B2B-1832: Error when reindex Catalog Search index during the snapshot of elasticsearch
1 parent df3203e commit 71ad358

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

app/code/Magento/Elasticsearch/Model/Adapter/Elasticsearch.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,11 @@ public function cleanIndex($storeId, $mappedIndexerId)
243243

244244
// remove index if already exists
245245
if ($this->client->indexExists($newIndexName)) {
246-
$this->client->deleteIndex($newIndexName);
246+
try {
247+
$this->client->deleteIndex($newIndexName);
248+
} catch (\Exception $e) {
249+
$this->logger->critical($e);
250+
}
247251
}
248252

249253
// prepare new index
@@ -372,7 +376,11 @@ public function updateAlias($storeId, $mappedIndexerId)
372376

373377
// remove obsolete index
374378
if ($oldIndex) {
375-
$this->client->deleteIndex($oldIndex);
379+
try {
380+
$this->client->deleteIndex($oldIndex);
381+
} catch (\Exception $e) {
382+
$this->logger->critical($e);
383+
}
376384
unset($this->indexByCode[$mappedIndexerId . '_' . $storeId]);
377385
}
378386

0 commit comments

Comments
 (0)