Skip to content

Commit

Permalink
Fix #23390: Progress Monitor needs to send child monitors to avoid be…
Browse files Browse the repository at this point in the history
…ing in the finished state

Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Jan 5, 2024
1 parent eff911c commit d565133
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,19 +330,22 @@ private DataSet readMvt(InputStream source, ProgressMonitor progressMonitor) thr
}
ds = new DataSet();
final var currentBounds = new Bounds(this.downloadArea);
progressMonitor.beginTask(tr("Downloading data"), 2 * tiles.size());
for (TileXYZ tileXYZ : tiles) {
try {
final var hilbert = PMTiles.convertToHilbert(tileXYZ.z(), tileXYZ.x(), tileXYZ.y());
final var data = this.info.getSourceType() == MapWithAIType.PMTILES
? new ByteArrayInputStream(PMTiles.readData(header, hilbert, cachedDirectories))
: getInputStream(getRequestForTile(tileXYZ), progressMonitor);
: getInputStream(getRequestForTile(tileXYZ), progressMonitor.createSubTaskMonitor(1, true));
final var dataSet = loadTile(tileSource, tileXYZ, data);
ds.mergeFrom(dataSet, progressMonitor);
ds.mergeFrom(dataSet, progressMonitor.createSubTaskMonitor(1, true));
tileXYZ.expandBounds(currentBounds);
} catch (OsmTransferException | IOException e) {
progressMonitor.finishTask();
throw new IllegalDataException(e);
}
}
progressMonitor.finishTask();
ds.addDataSource(new DataSource(currentBounds, this.url));
return ds;
}
Expand Down

0 comments on commit d565133

Please sign in to comment.