Changeset 9318 in josm


Ignore:
Timestamp:
2016-01-05T10:10:29+01:00 (9 years ago)
Author:
simon04
Message:

fix #11693 - Overpass download: set default timeout to 180s

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/OverpassDownloadReader.java

    r9308 r9318  
    111111        // see https://wiki.openstreetmap.org/wiki/Overpass_API/Overpass_QL#timeout
    112112        final Matcher timeoutMatcher = Pattern.compile("\\[timeout:(\\d+)\\]").matcher(overpassQuery);
     113        final int timeout;
    113114        if (timeoutMatcher.find()) {
    114             final int timeout = 1000 * Integer.parseInt(timeoutMatcher.group(1));
    115             request.setConnectTimeout(timeout);
    116             request.setReadTimeout(timeout);
     115            timeout = 1000 * Integer.parseInt(timeoutMatcher.group(1));
     116        } else {
     117            timeout = 180_000;
    117118        }
     119        request.setConnectTimeout(timeout);
     120        request.setReadTimeout(timeout);
    118121    }
    119122
Note: See TracChangeset for help on using the changeset viewer.