Fix context cache invalidation

This commit is contained in:
Luck
2018-06-15 19:07:24 +01:00
Unverified
parent 9c449def57
commit 6baa472567
2 changed files with 8 additions and 1 deletions
@@ -76,5 +76,9 @@ public abstract class ExpiringCache<T> implements Supplier<T> {
}
return this.value;
}
public void invalidate() {
this.expirationNanos = 0;
}
}
@@ -233,7 +233,10 @@ public abstract class ContextManager<T> {
throw new NullPointerException("subject");
}
this.subjectCaches.invalidate(subject);
ContextsCache<T> cache = this.subjectCaches.getIfPresent(subject);
if (cache != null) {
cache.invalidate();
}
}
Contexts calculate(T subject) {