Fix context cache invalidation

This commit is contained in:
Luck 2018-06-15 19:07:24 +01:00
parent 9c449def57
commit 6baa472567
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
2 changed files with 8 additions and 1 deletions

View File

@ -76,5 +76,9 @@ public abstract class ExpiringCache<T> implements Supplier<T> {
}
return this.value;
}
public void invalidate() {
this.expirationNanos = 0;
}
}

View File

@ -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) {