Skip to content

Commit

Permalink
fix: qodana
Browse files Browse the repository at this point in the history
  • Loading branch information
lukmzig committed Nov 14, 2024
1 parent 5a07fc6 commit c36bf63
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Repository/IndexQueueRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function generateSelectQuery(
public function enqueueBySelectQuery(DBALQueryBuilder $queryBuilder): void
{
$sql = <<<SQL
INSERT INTO
INSERT INTO
%s (elementId, elementType, elementIndexName, operation, operationTime, dispatched)
%s
ON DUPLICATE KEY
Expand All @@ -200,7 +200,7 @@ public function enqueueByItemList(array $enqueueItemList, IndexQueueOperation $o
}

$sql = <<<SQL
INSERT INTO
INSERT INTO
%s (elementId, elementType, elementIndexName, operation, operationTime, dispatched)
VALUES %s
ON DUPLICATE KEY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ private function doFetchIds(OpenSearchSearchInterface $search, string $indexName
return $ids;
}

private function doFetchIdsAndTypes(OpenSearchSearchInterface $search, string $indexName, ?array $searchAfter = null): array
private function doFetchIdsAndTypes(
OpenSearchSearchInterface $search,
string $indexName,
?array $searchAfter = null
): array
{
$search->setFrom(0);
$search->setSize($this->getPageSize());
Expand All @@ -101,7 +105,8 @@ private function doFetchIdsAndTypes(OpenSearchSearchInterface $search, string $i
elementType: $item->getSource()[FieldCategory::SYSTEM_FIELDS->value][SystemField::ELEMENT_TYPE->value],
index: $item->getIndex(),
),
$hits);
$hits
);
$lastHit = $searchResult->getLastHit();
if ($lastHit && (count($hits) === $this->getPageSize())) {
return array_merge($idsAndTypes, $this->doFetchIdsAndTypes($search, $indexName, $lastHit->getSort()));
Expand Down

0 comments on commit c36bf63

Please sign in to comment.