Skip to content

Commit

Permalink
Fix pagination function
Browse files Browse the repository at this point in the history
  • Loading branch information
Rylern committed Feb 28, 2025
1 parent 205b78e commit 7458e1b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/qupath/ext/omero/core/RequestSender.java
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ private static void logResponse(URI uri, HttpResponse<?> response, Throwable err

private List<JsonElement> readFollowingPages(String uri, int limit, int totalCount) {
return IntStream.iterate(limit, i -> i + limit)
.limit(max(0, (totalCount - limit) / limit))
.limit(max(0, (int) Math.ceil((float) (totalCount - limit) / limit)))
.mapToObj(offset -> URI.create(uri + "offset=" + offset))
.map(currentURI -> getAndConvertToJsonList(currentURI, "data"))
.map(CompletableFuture::join)
Expand Down

0 comments on commit 7458e1b

Please sign in to comment.