Avoid invalidating the cache if removing an entry doesn't exist
Closes #27852 Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
This commit is contained in:
parent
d679c13040
commit
f168b8cce9
1 changed files with 12 additions and 6 deletions
|
@ -192,8 +192,10 @@ public class UserAdapter implements CachedUserModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeAttribute(String name) {
|
public void removeAttribute(String name) {
|
||||||
getDelegateForUpdate();
|
if (getFirstAttribute(name) != null) {
|
||||||
updated.removeAttribute(name);
|
getDelegateForUpdate();
|
||||||
|
updated.removeAttribute(name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -229,8 +231,10 @@ public class UserAdapter implements CachedUserModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeRequiredAction(RequiredAction action) {
|
public void removeRequiredAction(RequiredAction action) {
|
||||||
getDelegateForUpdate();
|
if (getRequiredActionsStream().anyMatch(s -> Objects.equals(s, action.name()))) {
|
||||||
updated.removeRequiredAction(action);
|
getDelegateForUpdate();
|
||||||
|
updated.removeRequiredAction(action);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -241,8 +245,10 @@ public class UserAdapter implements CachedUserModel {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeRequiredAction(String action) {
|
public void removeRequiredAction(String action) {
|
||||||
getDelegateForUpdate();
|
if (getRequiredActionsStream().anyMatch(s -> Objects.equals(s, action))) {
|
||||||
updated.removeRequiredAction(action);
|
getDelegateForUpdate();
|
||||||
|
updated.removeRequiredAction(action);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue