Skip to content

Commit

Permalink
MSEARCH-794: fix fetch offset and limit
Browse files Browse the repository at this point in the history
  • Loading branch information
mukhiddin-yusuf committed Aug 16, 2024
1 parent 09f8fe5 commit 2918649
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ private List<MergeRangeEntity> constructRecordMergeRanges(int recordsCount,
var upperId = recordIds.get(recordIds.size() - 1);
ranges.add(mergeEntity(UUID.randomUUID(), recordType, tenantId, lowerId, upperId, Timestamp.from(Instant.now())));
for (int i = 1; i < pages; i++) {
int offset = i * rangeSize;
int limit = Math.min(rangeSize, recordsCount - offset);
//int offset = i * rangeSize;
//int limit = Math.min(rangeSize, recordsCount - offset);
query = CqlQuery.greaterThan(CqlQueryParam.ID, lowerId.toString());
recordIds =
inventoryService.fetchInventoryRecordIds(recordType, CqlQuery.sortBy(query, CqlQueryParam.ID), offset, limit);
inventoryService.fetchInventoryRecordIds(recordType, CqlQuery.sortBy(query, CqlQueryParam.ID), 0, rangeSize);
lowerId = recordIds.get(0);
upperId = recordIds.get(recordIds.size() - 1);
ranges.add(mergeEntity(UUID.randomUUID(), recordType, tenantId, lowerId, upperId, Timestamp.from(Instant.now())));
Expand Down

0 comments on commit 2918649

Please sign in to comment.