Fix bad caching logic resulting in super high CPU usage
This commit is contained in:
+3
-9
@@ -179,9 +179,7 @@ public class LPPermissionAttachment extends PermissionAttachment {
|
||||
|
||||
// set the transient node
|
||||
User user = this.permissible.getUser();
|
||||
if (user.setTransientPermission(transientNode).asBoolean()) {
|
||||
user.reloadCachedData();
|
||||
}
|
||||
user.setTransientPermission(transientNode).asBoolean();
|
||||
}
|
||||
|
||||
private void unsetPermissionInternal(String name) {
|
||||
@@ -191,17 +189,13 @@ public class LPPermissionAttachment extends PermissionAttachment {
|
||||
|
||||
// remove transient permissions from the holder which were added by this attachment & equal the permission
|
||||
User user = this.permissible.getUser();
|
||||
if (user.removeIfTransient(n -> n instanceof ImmutableTransientNode && ((ImmutableTransientNode) n).getOwner() == this && n.getPermission().equals(name))) {
|
||||
user.reloadCachedData();
|
||||
}
|
||||
user.removeIfTransient(n -> n instanceof ImmutableTransientNode && ((ImmutableTransientNode) n).getOwner() == this && n.getPermission().equals(name));
|
||||
}
|
||||
|
||||
private void clearInternal() {
|
||||
// remove all transient permissions added by this attachment
|
||||
User user = this.permissible.getUser();
|
||||
if (user.removeIfTransient(n -> n instanceof ImmutableTransientNode && ((ImmutableTransientNode) n).getOwner() == this)) {
|
||||
user.reloadCachedData();
|
||||
}
|
||||
user.removeIfTransient(n -> n instanceof ImmutableTransientNode && ((ImmutableTransientNode) n).getOwner() == this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user