File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/workers Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 2020import org .openstreetmap .josm .plugins .mapillary .data .mapillary .MapillarySequence ;
2121import org .openstreetmap .josm .plugins .mapillary .gui .layer .MapillaryLayer ;
2222import org .openstreetmap .josm .plugins .mapillary .utils .MapillaryImageUtils ;
23+ import org .openstreetmap .josm .spi .preferences .Config ;
2324import org .openstreetmap .josm .tools .JosmRuntimeException ;
2425import org .openstreetmap .josm .tools .Logging ;
2526import org .openstreetmap .josm .tools .Pair ;
@@ -121,7 +122,13 @@ protected MapillarySequence doInBackground() {
121122 }
122123
123124 private void getImageRange (int i , long [] imagesToGet , long [] images ) {
125+ int retries = 0 ;
124126 Map <String , List <MapillaryNode >> map = MapillaryDownloader .downloadImages (imagesToGet );
127+ while (retries < Config .getPref ().getInt ("mapillary.image.retries" , 10 ) && (map .size () != 1
128+ || !map .containsKey (this .sequenceKey ) || map .get (this .sequenceKey ).size () != imagesToGet .length )) {
129+ map = MapillaryDownloader .downloadImages (imagesToGet );
130+ retries ++;
131+ }
125132 if (map .size () != 1 || !map .containsKey (this .sequenceKey )) {
126133 throw new IllegalArgumentException (
127134 "Mapillary sequence " + this .sequenceKey + " did not download any images" );
You can’t perform that action at this time.
0 commit comments