Further optimizations

Closes #33353

Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
This commit is contained in:
Alexander Schwartz 2024-09-27 18:05:01 +02:00 committed by Pedro Igor
parent 5c503a55e9
commit fd1f3c52d3
2 changed files with 5 additions and 3 deletions

View file

@ -245,7 +245,7 @@ public class InfinispanOrganizationProvider implements OrganizationProvider {
String cacheKey = cacheKeyMembership(getRealm(), organization, member);
CachedMembership cached = realmCache.getCache().get(cacheKey, CachedMembership.class);
if (cached == null) {
if (cached == null && !isInvalid(cacheKey)) {
return getDelegate().isManagedMember(organization, user);
}

View file

@ -153,12 +153,14 @@ public class OrganizationAdapter implements OrganizationModel {
@Override
public boolean isManaged(UserModel user) {
return delegate.get().isManagedMember(this, user);
if (isUpdated()) delegate.get().isManagedMember(this, user);
return organizationCache.isManagedMember(this, user);
}
@Override
public boolean isMember(UserModel user) {
return delegate.get().isMember(this, user);
if (isUpdated()) delegate.get().isMember(this, user);
return organizationCache.isMember(this, user);
}
@Override