Skip to content

Commit

Permalink
Attempt to improve output in poor network conditions
Browse files Browse the repository at this point in the history
This is done by using whatever has been downloaded, even if it doesn't have everything

Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Sep 16, 2024
1 parent 3b464bd commit 5ee10ff
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,11 @@ protected MapillarySequence doInBackground() {

private void getImageRange(int i, long[] imagesToGet, long[] images) {
int retries = 0;
Map<String, List<MapillaryNode>> map = MapillaryDownloader.downloadImages(imagesToGet);
final Map<String, List<MapillaryNode>> map = MapillaryDownloader.downloadImages(imagesToGet);
while (retries < Config.getPref().getInt("mapillary.image.retries", 10) && (map.size() != 1
|| !map.containsKey(this.sequenceKey) || map.get(this.sequenceKey).size() != imagesToGet.length)) {
map = MapillaryDownloader.downloadImages(imagesToGet);
MapillaryDownloader.downloadImages(imagesToGet).forEach(
(key, value) -> map.merge(key, value, (list1, list2) -> list1.size() > list2.size() ? list1 : list2));
retries++;
}
if (map.size() != 1 || !map.containsKey(this.sequenceKey)) {
Expand Down

0 comments on commit 5ee10ff

Please sign in to comment.