Cache calls querying parent groups in bridge subjects - closes #69
This commit is contained in:
@@ -116,6 +116,9 @@ public abstract class PermissionHolder {
|
||||
@Getter
|
||||
private final Lock ioLock = new ReentrantLock();
|
||||
|
||||
@Getter
|
||||
private final Set<Runnable> stateListeners = ConcurrentHashMap.newKeySet();
|
||||
|
||||
|
||||
/*
|
||||
* CACHES - cache the result of a number of methods in this class, until they are invalidated.
|
||||
@@ -178,6 +181,15 @@ public abstract class PermissionHolder {
|
||||
getAllNodesFilteredCache.invalidateAll();
|
||||
exportNodesCache.invalidateAll();
|
||||
|
||||
// Invalidate listeners
|
||||
for (Runnable r : stateListeners) {
|
||||
try {
|
||||
r.run();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
// Get previous references
|
||||
Set<HolderReference> refs = plugin.getCachedStateManager().getInheritances(toReference());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user