Skip to content

Commit

Permalink
use opensearch exception
Browse files Browse the repository at this point in the history
  • Loading branch information
AlternateIf committed Dec 2, 2024
1 parent 6821a25 commit 41f1bb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/IndexService/Worker/OpenSearch/AbstractOpenSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ protected function getNextIndexVersion(): int
* @param string $sourceIndexName the name of the source index in ES.
* @param string $targetIndexName the name of the target index in ES. If existing, will be deleted
*
* @throws \Exception
* @throws \OpenSearch\Common\Exceptions\OpenSearchException
*/
protected function performReindex(string $sourceIndexName, string $targetIndexName): void
{
Expand Down Expand Up @@ -926,7 +926,7 @@ protected function performReindex(string $sourceIndexName, string $targetIndexNa
}

if ($taskResponse === null || !isset($taskResponse['completed']) || $taskResponse['completed'] === false) {

Check failure on line 928 in src/IndexService/Worker/OpenSearch/AbstractOpenSearch.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.2, highest, false)

Strict comparison using === between array and null will always evaluate to false.

Check failure on line 928 in src/IndexService/Worker/OpenSearch/AbstractOpenSearch.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.3, highest, false)

Strict comparison using === between array and null will always evaluate to false.
throw new \Exception('reindex is not finished. Cleanup task index for task ' . $taskId);
throw new \OpenSearch\Common\Exceptions\RequestTimeout408Exception('reindex is not finished. Cleanup task index for task ' . $taskId);
}

Logger::info(sprintf('Completed re-index in %.02f seconds.', (time() - $startTime)));
Expand Down

0 comments on commit 41f1bb7

Please sign in to comment.