From 6bba7f773bb6c4217607439f9adab8814bcd0ac6 Mon Sep 17 00:00:00 2001 From: Andreas Knab Date: Wed, 6 Nov 2024 10:08:56 +0100 Subject: [PATCH] Add minimum batch size to avoid infinite loop due to zero batch size --- .../templates/webclient/annotations/omero_table.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/omeroweb/webclient/templates/webclient/annotations/omero_table.html b/omeroweb/webclient/templates/webclient/annotations/omero_table.html index 319d265dde..d49a8990f2 100644 --- a/omeroweb/webclient/templates/webclient/annotations/omero_table.html +++ b/omeroweb/webclient/templates/webclient/annotations/omero_table.html @@ -213,10 +213,11 @@

{{ data.name }}

enableDownloadButtons(false); const rowCount = filter ? parseInt("{{ meta.totalCount }}") : parseInt("{{ meta.rowCount }}"); const tableName = "{{ data.name }}.csv"; - // Use 10 batches, or max 3000 rows per batch + // Use 10 batches, or max 3000 rows per batch, with a minimum of 10 const MAX_BATCH_ROWS = 3000; + const MIN_BATCH_ROWS = 10; const MAX_FAILED_CALLS = 5; - const batchSize = Math.min(parseInt(rowCount/10), MAX_BATCH_ROWS); + const batchSize = Math.max(Math.min(parseInt(rowCount/10), MAX_BATCH_ROWS), MIN_BATCH_ROWS); // load csv in batches... const csvUrl = "{% url 'omero_table' data.id 'csv' %}";