From 1ef234fd9ba1170f4c2fa08e3ee9acc775300833 Mon Sep 17 00:00:00 2001 From: carlosuc3m <100329787@alumnos.uc3m.es> Date: Mon, 30 Oct 2023 16:29:50 +0100 Subject: [PATCH] avoid printing when the thread is closed --- .../modelrunner/bioimageio/download/DownloadTracker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/bioimage/modelrunner/bioimageio/download/DownloadTracker.java b/src/main/java/io/bioimage/modelrunner/bioimageio/download/DownloadTracker.java index 4fb7c5a7..d331ae7e 100644 --- a/src/main/java/io/bioimage/modelrunner/bioimageio/download/DownloadTracker.java +++ b/src/main/java/io/bioimage/modelrunner/bioimageio/download/DownloadTracker.java @@ -501,7 +501,7 @@ public static void printProgress(Thread downloadThread, && consumer.get().get(TOTAL_PROGRESS_KEY) == 1.0; int millis = keep == true || end ? 10 : 3000; keep = false; - try {Thread.sleep(millis);} catch (InterruptedException ex) {Thread.currentThread().interrupt();} + try {Thread.sleep(millis);} catch (InterruptedException ex) {continue;} String select = null; for (String key : consumer.get().keySet()) { if (!already.contains(key) && !key.equals(DownloadTracker.TOTAL_PROGRESS_KEY)) {