Changeset 10558 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2016-07-17T20:43:22+02:00 (8 years ago)
Author:
wiktorn
Message:

Do not cache IOException in JCS, they should be cached only in memory.

Caching IOException in JCS Cache leads to the situation, where errors
are cached for DEFAULT_EXPIRE_TIME which causes the error message to
stay too long on user screen.

Fix tests for JCSCachedTileLoaderJob

See: #13128

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/cache/JCSCachedTileLoaderJob.java

    r10545 r10558  
    391391            } else {
    392392                attributes.setError(e);
    393                 attributes.setResponseCode(499); // set dummy error code
    394                 boolean doCache = isResponseLoadable(null, 499, null) || cacheAsEmpty(); //generic 499 error code returned
    395                 if (doCache) {
    396                     cacheData = createCacheEntry(new byte[]{});
    397                     cache.put(getCacheKey(), createCacheEntry(new byte[]{}), attributes);
    398                 }
    399                 return doCache;
     393                attributes.setResponseCode(599); // set dummy error code, greater than 500 so it will be not cached
     394                return false;
    400395            }
    401396
Note: See TracChangeset for help on using the changeset viewer.