pgImport.done();
clearCache();
} catch (IOException e) {
- Instance.syserr(e);
+ Instance.getTraceHandler().error(e);
}
pgImport.done();
@Override
public synchronized Story save(Story story, String luid, Progress pg)
throws IOException {
- story = lib.save(story, luid, pg);
+ Progress pgLib = new Progress();
+ Progress pgCacheLib = new Progress();
+
+ if (pg == null) {
+ pg = new Progress();
+ }
+
+ pg.setMinMax(0, 2);
+ pg.addProgress(pgLib, 1);
+ pg.addProgress(pgCacheLib, 1);
+
+ story = lib.save(story, luid, pgLib);
+ story = cacheLib.save(story, luid, pgCacheLib);
+
clearCache();
+
return story;
}
pg.addProgress(pgCache, 1);
pg.addProgress(pgOrig, 1);
- cacheLib.changeSource(luid, newSource, pgCache);
+ if (isCached(luid)) {
+ cacheLib.changeSource(luid, newSource, pgCache);
+ }
pgCache.done();
lib.changeSource(luid, newSource, pgOrig);
pgOrig.done();
* in case of I/O error
*/
public void clearFromCache(String luid) throws IOException {
- cacheLib.delete(luid);
- clearCache();
+ if (isCached(luid)) {
+ cacheLib.delete(luid);
+ clearCache();
+ }
}
// All the following methods are only used by Save and Delete in