Suppress exceptions, if the http cache cannot be deleted
This commit is contained in:
parent
de282d24a6
commit
d5f453a7a1
|
@ -441,12 +441,16 @@ public class CamrecApplication extends Application {
|
|||
}
|
||||
|
||||
private void clearHttpCache() throws IOException {
|
||||
File httpCacheDir = new File(config.getConfigDir(), "cache");
|
||||
LOG.debug("Deleting http cache {}", httpCacheDir);
|
||||
HttpClientCacheProvider.getCache(config).evictAll();
|
||||
HttpClientCacheProvider.getCache(config).close();
|
||||
IoUtils.deleteDirectory(httpCacheDir);
|
||||
LOG.debug("Cache has been deleted");
|
||||
try {
|
||||
File httpCacheDir = new File(config.getConfigDir(), "cache");
|
||||
LOG.debug("Deleting http cache {}", httpCacheDir);
|
||||
HttpClientCacheProvider.getCache(config).evictAll();
|
||||
HttpClientCacheProvider.getCache(config).close();
|
||||
IoUtils.deleteDirectory(httpCacheDir);
|
||||
LOG.debug("Cache has been deleted");
|
||||
} catch (Exception e) {
|
||||
LOG.info("The HTTP cache was not completely deleted: {}", e.getLocalizedMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void registerAlertSystem() {
|
||||
|
|
Loading…
Reference in New Issue