fix to preload offline sessions faster

slow loading offline tokens during start up leads to connection timeout
closes #24295
This commit is contained in:
ashwingroot 2023-10-26 19:47:32 +05:30 committed by Alexander Schwartz
parent 5464205ab2
commit dee1cec290

View file

@ -519,13 +519,15 @@ public class JpaUserSessionPersisterProvider implements UserSessionPersisterProv
model.setClientId(clientId);
model.setUserSessionId(userSession.getId());
UserModel user = userSession.getUser();
if (user != null) {
model.setUserId(user.getId());
}
else if (userSession instanceof PersistentUserSessionAdapter) {
if (userSession instanceof PersistentUserSessionAdapter) {
model.setUserId(((PersistentUserSessionAdapter) userSession).getUserId());
}
else {
UserModel user = userSession.getUser();
if (user != null) {
model.setUserId(user.getId());
}
}
model.setTimestamp(entity.getTimestamp());
model.setData(entity.getData());
return new PersistentAuthenticatedClientSessionAdapter(session, model, realm, client, userSession);