diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/download/MapWithAIDownloadReader.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/download/MapWithAIDownloadReader.java index 6d6ac05..8a59eab 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/download/MapWithAIDownloadReader.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/gui/download/MapWithAIDownloadReader.java @@ -11,6 +11,8 @@ import java.awt.GridBagLayout; import java.util.Collection; import java.util.List; import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; import java.util.function.Consumer; import javax.swing.Icon; @@ -47,14 +49,16 @@ public class MapWithAIDownloadReader implements DownloadSource { + try { + task.download(params, area, null).get(300, TimeUnit.SECONDS); + } catch (InterruptedException e) { + Logging.error(e); + Thread.currentThread().interrupt(); + } catch (ExecutionException | TimeoutException e) { + Logging.error(e); + } + }); } @Override