fix to preload offline sessions faster
slow loading offline tokens during start up leads to connection timeout closes #24295
This commit is contained in:
parent
5464205ab2
commit
dee1cec290
1 changed files with 7 additions and 5 deletions
|
@ -519,13 +519,15 @@ public class JpaUserSessionPersisterProvider implements UserSessionPersisterProv
|
||||||
model.setClientId(clientId);
|
model.setClientId(clientId);
|
||||||
model.setUserSessionId(userSession.getId());
|
model.setUserSessionId(userSession.getId());
|
||||||
|
|
||||||
UserModel user = userSession.getUser();
|
if (userSession instanceof PersistentUserSessionAdapter) {
|
||||||
if (user != null) {
|
|
||||||
model.setUserId(user.getId());
|
|
||||||
}
|
|
||||||
else if (userSession instanceof PersistentUserSessionAdapter) {
|
|
||||||
model.setUserId(((PersistentUserSessionAdapter) userSession).getUserId());
|
model.setUserId(((PersistentUserSessionAdapter) userSession).getUserId());
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
UserModel user = userSession.getUser();
|
||||||
|
if (user != null) {
|
||||||
|
model.setUserId(user.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
model.setTimestamp(entity.getTimestamp());
|
model.setTimestamp(entity.getTimestamp());
|
||||||
model.setData(entity.getData());
|
model.setData(entity.getData());
|
||||||
return new PersistentAuthenticatedClientSessionAdapter(session, model, realm, client, userSession);
|
return new PersistentAuthenticatedClientSessionAdapter(session, model, realm, client, userSession);
|
||||||
|
|
Loading…
Reference in a new issue