[HER-1710] on problem loading persist log, close reader

This commit is contained in:
nlevitt
2009-11-18 03:02:28 +00:00
parent 56055d8236
commit be81d3733a
@@ -202,10 +202,17 @@ public abstract class PersistProcessor extends Processor {
logger.fine(splits[0] + " " + ArchiveUtils.prettyString(alist));
}
if (historyMap != null) {
// XXX allow RuntimeExceptions to propagate
if (historyMap != null) try {
historyMap.put(splits[0], alist);
} catch (Exception e) {
logger.log(Level.SEVERE, "caught exception after loading " + count +
" urls from the persist log (perhaps crawl was stopped by user?)", e);
IOUtils.closeQuietly(persistLogReader);
// seems to finish most cleanly when we return rather than throw something
return count;
}
count++;
}
IOUtils.closeQuietly(persistLogReader);