From efe0f0b5189a12497e8f2af9198d85554c1cddfd Mon Sep 17 00:00:00 2001 From: carlosuc3m <100329787@alumnos.uc3m.es> Date: Thu, 9 Jan 2025 18:05:59 +0100 Subject: [PATCH] improe robustness --- .../modelrunner/bioimageio/download/DownloadTracker.java | 3 ++- 1 file changed, 2 insertions(+), 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 2aed4136..a2c0168f 100644 --- a/src/main/java/io/bioimage/modelrunner/bioimageio/download/DownloadTracker.java +++ b/src/main/java/io/bioimage/modelrunner/bioimageio/download/DownloadTracker.java @@ -500,7 +500,8 @@ public static void printProgress(Thread downloadThread, Set already = new HashSet(); while (Thread.currentThread().isAlive() && downloadThread.isAlive()) { long waitMillis = 0; - while (consumer.get().get(TOTAL_PROGRESS_KEY) < 1.0 && waitMillis < 3000) { + while ((consumer.get().get(TOTAL_PROGRESS_KEY) == null || consumer.get().get(TOTAL_PROGRESS_KEY) < 1.0) + && waitMillis < 3000) { Thread.sleep(30); waitMillis += 30; }