KEYCLOAK-18981 Infinispan: prevent fetching all sessions from remotes
This commit is contained in:
parent
271033c3a4
commit
7c0d10130e
1 changed files with 2 additions and 3 deletions
|
@ -369,9 +369,8 @@ public class InfinispanUserSessionProvider implements UserSessionProvider {
|
|||
cache = CacheDecorators.skipCacheLoaders(cache);
|
||||
|
||||
// return a stream that 'wraps' the infinispan cache stream so that the cache stream's elements are read one by one
|
||||
// and then filtered/mapped locally to avoid serialization issues when trying to manipulate the cache stream directly.
|
||||
return StreamSupport.stream(cache.entrySet().stream().spliterator(), true)
|
||||
.filter(predicate)
|
||||
// and then mapped locally to avoid serialization issues when trying to manipulate the cache stream directly.
|
||||
return StreamSupport.stream(cache.entrySet().stream().filter(predicate).spliterator(), true)
|
||||
.map(Mappers.userSessionEntity())
|
||||
.map(entity -> this.wrap(realm, entity, offline));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue