Skip to content

Commit 57955b7

Browse files
committed
Polish
See gh-1111
1 parent d5da38f commit 57955b7

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
@@ -151,13 +151,10 @@ public Mono<Void> save(RedisSession session) {
151151
if (session.isNew) {
152152
return result;
153153
}
154-
else if (session.hasChangedSessionId()) {
155-
String sessionKey = getSessionKey(session.originalSessionId);
156-
return this.sessionRedisOperations.hasKey(sessionKey)
157-
.flatMap((exists) -> exists ? result : Mono.empty());
158-
}
159154
else {
160-
String sessionKey = getSessionKey(session.getId());
155+
String sessionKey = getSessionKey(
156+
session.hasChangedSessionId() ? session.originalSessionId
157+
: session.getId());
161158
return this.sessionRedisOperations.hasKey(sessionKey)
162159
.flatMap((exists) -> exists ? result : Mono.empty());
163160
}

0 commit comments

Comments
 (0)