Skip to content

Commit ff10709

Browse files
committed
Polish
See gh-1185
1 parent 6e471f6 commit ff10709

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

spring-session-data-redis/src/main/java/org/springframework/session/data/redis/ReactiveRedisOperationsSessionRepository.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,13 +142,10 @@ public Mono<Void> save(RedisSession session) {
142142
if (session.isNew) {
143143
return result;
144144
}
145-
else if (session.hasChangedSessionId()) {
146-
String sessionKey = getSessionKey(session.originalSessionId);
147-
return this.sessionRedisOperations.hasKey(sessionKey)
148-
.flatMap((exists) -> exists ? result : Mono.empty());
149-
}
150145
else {
151-
String sessionKey = getSessionKey(session.getId());
146+
String sessionKey = getSessionKey(
147+
session.hasChangedSessionId() ? session.originalSessionId
148+
: session.getId());
152149
return this.sessionRedisOperations.hasKey(sessionKey)
153150
.flatMap((exists) -> exists ? result : Mono.empty());
154151
}

0 commit comments

Comments
 (0)