From 8f856c8f8b80ce61ef83e76bba99ea3b485f3acf Mon Sep 17 00:00:00 2001 From: mARTin-B78 Date: Tue, 6 Oct 2026 12:00:33 +0200 Subject: [PATCH] fix(sonar): move default out of runPool parameter list (javascript:S1788) Co-Authored-By: Claude Sonnet 5.5 --- static/js/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/js/utils.js b/static/js/utils.js index cba53a9..b3b59c6 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -358,9 +358,9 @@ function ttvcIsLowMemoryDevice() { window.ttvcIsLowMemoryDevice = ttvcIsLowMemoryDevice; // Run an async worker over items with bounded concurrency (default 4). `onProgress(done,total)` // fires after each item. Replaces slow serial `for…await` loops over network calls. -async function runPool(items, worker, concurrency = 4, onProgress) { +async function runPool(items, worker, concurrency, onProgress) { const arr = [...items]; let i = 0, done = 0; const total = arr.length; - const requested = Math.max(1, Number(concurrency) || 1); + const requested = Math.max(1, Number(concurrency ?? 4) || 1); const effectiveConcurrency = ttvcIsLowMemoryDevice() ? Math.min(2, requested) : requested; async function run() { while (i < arr.length) {