renew cache update time if a cache-read hit happens

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2135 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent 81e79f2caf
commit 912116c5a7

@ -202,7 +202,11 @@ public class kelondroObjectCache {
public Object get(String key) {
if (key == null) return null;
Object r = cache.get(key);
Object r = null;
synchronized(cache) {
r = cache.get(key);
ages.setScore(key, intTime(System.currentTimeMillis())); // renew cache update time
}
flushc();
if (r == null) this.readMiss++; else this.readHit++;
return r;
@ -237,6 +241,7 @@ public class kelondroObjectCache {
if (key == null) return 0;
synchronized(cache) {
if (hasnot.getScore(key) > 0) {
hasnot.setScore(key, intTime(System.currentTimeMillis())); // renew cache update time
this.hasnotHit++;
return -1;
}

Loading…
Cancel
Save