git://git.nikiroo.be
/
fanfix.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b9ce9ca
)
Improve CacheLibrary Save()
author
Niki Roo
<niki@nikiroo.be>
Sat, 2 Dec 2017 14:01:56 +0000
(15:01 +0100)
committer
Niki Roo
<niki@nikiroo.be>
Sat, 2 Dec 2017 14:01:56 +0000
(15:01 +0100)
src/be/nikiroo/fanfix/library/CacheLibrary.java
patch
|
blob
|
blame
|
history
diff --git
a/src/be/nikiroo/fanfix/library/CacheLibrary.java
b/src/be/nikiroo/fanfix/library/CacheLibrary.java
index da6f56d3fa8fac1a097ad6df9ee47ac3f0dc5b42..f665e383cad2f43f6c0b1807d56e5fdb69705b13 100644
(file)
--- a/
src/be/nikiroo/fanfix/library/CacheLibrary.java
+++ b/
src/be/nikiroo/fanfix/library/CacheLibrary.java
@@
-126,8
+126,22
@@
public class CacheLibrary extends BasicLibrary {
@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;
}