From 050bfce75b43e722bf18fccdece0275ff299da91 Mon Sep 17 00:00:00 2001 From: Andrew Byrd Date: Thu, 31 Oct 2024 22:36:13 +0800 Subject: [PATCH] move initial message back to async runnable Just to keep behavior more similar to previous versions. This could be changed in the future if we do a more significant refactor of how exceptions are handled and passed up to the backend. --- src/main/java/com/conveyal/r5/util/AsyncLoader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/conveyal/r5/util/AsyncLoader.java b/src/main/java/com/conveyal/r5/util/AsyncLoader.java index 62fe4034b..256ee5c2b 100644 --- a/src/main/java/com/conveyal/r5/util/AsyncLoader.java +++ b/src/main/java/com/conveyal/r5/util/AsyncLoader.java @@ -102,7 +102,6 @@ public String toString() { * Any exceptions that occur while building the value will escape this method, leaving the status as BUILDING. */ protected V getBlocking (K key) { - setProgress(key, 0, "Starting..."); V value = buildValue(key); synchronized (map) { map.put(key, new LoaderState(Status.PRESENT, "Loaded", 100, value)); @@ -135,6 +134,7 @@ public LoaderState get (K key) { if (enqueueLoadTask) { executor.execute(() -> { try { + setProgress(key, 0, "Starting..."); getBlocking(key); } catch (Throwable t) { // It's essential to trap Throwable rather than just Exception. Otherwise the executor