From c8ada0124db56c5d8869394408a501f1cc4239a4 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Sun, 28 Aug 2022 08:57:03 +0100 Subject: [PATCH] fix last batch sizing --- .../src/main/groovy/com/muwire/core/search/BrowseSession.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/groovy/com/muwire/core/search/BrowseSession.groovy b/core/src/main/groovy/com/muwire/core/search/BrowseSession.groovy index 440a2fa0..2a104fdb 100644 --- a/core/src/main/groovy/com/muwire/core/search/BrowseSession.groovy +++ b/core/src/main/groovy/com/muwire/core/search/BrowseSession.groovy @@ -160,7 +160,7 @@ class BrowseSession implements Runnable { if (j == batch.length) { eventBus.publish(new UIResultBatchEvent(results: batch, uuid: uuid)) j = 0 - batch = new UIResultEvent[Math.min(results - i - 1, BATCH_SIZE)] + batch = new UIResultEvent[Math.min(files - i - 1, BATCH_SIZE)] log.fine("publishing batch, next batch size ${batch.length}") } }