Fix group changes via the API not properly invalidating caches (#1534)

This commit is contained in:
Luck committed 2019-05-20 10:42:48 +01:00
1 parent 2e16b15b0e
commit 8d8024ba5e
21 files changed
+193 -102

No files matched your search

@@ -313,8 +313,8 @@ public abstract class CalculatedSubject implements LPSubject {
}
@Override
public void performCleanup() {
this.cachedData.doCacheCleanup();
public void performCacheCleanup() {
this.cachedData.performCacheCleanup();
}
@Override
@@ -166,10 +166,15 @@ public abstract class PermissionHolderSubject<T extends PermissionHolder> implem
return this.plugin.getService().getRootDefaults().getOption(contexts, s);
}
@Override
public void performCacheCleanup() {
// do nothing, permission holders are "cleaned up" by a different task
}
@Override
public void invalidateCaches() {
// invalidate for all changes
this.parent.invalidateCachedData();
this.parent.getCachedData().invalidate();
}
}
@@ -40,7 +40,7 @@ public class ServiceCacheHousekeepingTask implements Runnable {
public void run() {
for (LPSubjectCollection collection : this.service.getLoadedCollections().values()) {
for (LPSubject subject : collection.getLoadedSubjects()) {
subject.performCleanup();
subject.performCacheCleanup();
}
}
}