- Timestamp:
- 2009-02-14T12:13:31+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java
r1338 r1395 227 227 } 228 228 if (retCode != 200 && retCode != 412) { 229 230 229 if (retries >= 0) { 231 230 retries--; 232 System.out.print("backing off for 10 seconds..."); 233 Thread.sleep(10000); 231 if(sleepAndListen()) return false; 234 232 System.out.println("retrying ("+retries+" left)"); 235 233 return startChangeset(retries, comment); … … 332 330 if (retries >= 0) { 333 331 retries--; 334 System.out.print("backing off for 10 seconds..."); 335 Thread.sleep(10000); 332 if(sleepAndListen()) return; 336 333 System.out.println("retrying ("+retries+" left)"); 337 334 stopChangeset(retries); … … 414 411 if (retries >= 0) { 415 412 retries--; 416 System.out.print("backing off for 10 seconds..."); 417 Thread.sleep(10000); 413 if(sleepAndListen()) return; 418 414 System.out.println("retrying ("+retries+" left)"); 419 415 stopChangeset(retries); … … 456 452 throw new RuntimeException(e.getMessage()+ " " + e.getClass().getCanonicalName(), e); 457 453 } 454 } 455 456 private boolean sleepAndListen() { 457 // System.out.print("backing off for 10 seconds..."); 458 for(int i=0; i < 10; i++) { 459 if(cancel || isAuthCancelled()) { 460 if(!cancel) cancel(); 461 return true; 462 } 463 try { 464 Thread.sleep(1000); 465 } catch (InterruptedException ex) {} 466 } 467 return false; 458 468 } 459 469 … … 580 590 if (retries >= 0 && retCode != 412) { 581 591 retries--; 582 System.out.print("backing off for 10 seconds..."); 583 Thread.sleep(10000); 592 if(sleepAndListen()) return; 584 593 System.out.println("retrying ("+retries+" left)"); 585 594 sendRequestRetry(requestMethod, urlSuffix, osm, body, retries);
Note:
See TracChangeset
for help on using the changeset viewer.