Skip to content

Commit

Permalink
move initial message back to async runnable
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
abyrd committed Oct 31, 2024
1 parent 2c1bc95 commit 050bfce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/com/conveyal/r5/util/AsyncLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -135,6 +134,7 @@ public LoaderState<V> 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
Expand Down

0 comments on commit 050bfce

Please sign in to comment.