Changeset 1859 in josm
- Timestamp:
- 2009-07-27T08:17:38+02:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r1811 r1859 355 355 356 356 private void sleepAndListen() throws OsmTransferCancelledException { 357 // System.out.print("backing off for 10 seconds...");357 System.out.print(tr("Waiting 10 seconds ... ")); 358 358 for(int i=0; i < 10; i++) { 359 359 if (cancel || isAuthCancelled()) … … 363 363 } catch (InterruptedException ex) {} 364 364 } 365 System.out.println(tr("OK - trying again.")); 366 } 367 368 /** 369 * Replies the max. number of retries in case of 5XX errors on the server 370 * 371 * @return the max number of retries 372 */ 373 protected int getMaxRetries() { 374 int ret = Main.pref.getInteger("osm-server.max-num-retries", DEFAULT_MAX_NUM_RETRIES); 375 return Math.max(ret,0); 365 376 } 366 377 … … 385 396 StringBuffer responseBody = new StringBuffer(); 386 397 387 int retries = Main.pref.getInteger("osm-server.max-num-retries", DEFAULT_MAX_NUM_RETRIES); 388 retries = Math.max(0,retries); 398 int retries = getMaxRetries(); 389 399 390 400 while(true) { // the retry loop … … 423 433 if (retries-- > 0) { 424 434 sleepAndListen(); 435 int maxRetries = getMaxRetries(); 436 System.out.println(tr("Starting retry {0} of {1}.", maxRetries - retries,maxRetries)); 425 437 continue; 426 438 }
Note:
See TracChangeset
for help on using the changeset viewer.