Skip to content

Commit 44a6da4

Browse files
kinsershmarcusdacoregio
authored andcommitted
1 parent 9dbf18a commit 44a6da4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,13 +385,17 @@ private Mono<RedisSession> getSession(String sessionId, boolean allowExpired) {
385385

386386
@Override
387387
public Mono<Void> deleteById(String id) {
388+
return internalDeleteById(id).then();
389+
}
390+
391+
public Mono<Session> internalDeleteById(String id) {
388392
// @formatter:off
389393
return getSession(id, true)
390394
.flatMap((session) -> this.sessionRedisOperations.delete(getExpiredKey(session.getId()))
391395
.thenReturn(session))
392396
.flatMap((session) -> this.sessionRedisOperations.delete(getSessionKey(session.getId())).thenReturn(session))
393397
.flatMap((session) -> this.indexer.delete(session.getId()).thenReturn(session))
394-
.flatMap((session) -> this.expirationStore.remove(session.getId()));
398+
.flatMap((session) -> this.expirationStore.remove(session.getId()).thenReturn(session));
395399
// @formatter:on
396400
}
397401

@@ -438,8 +442,7 @@ private Mono<Void> onKeyDestroyedMessage(ReactiveSubscription.Message<String, St
438442
int sessionIdBeginIndex = key.lastIndexOf(":") + 1;
439443
return key.substring(sessionIdBeginIndex);
440444
})
441-
.flatMap((sessionId) -> getSession(sessionId, true))
442-
.flatMap((session) -> this.deleteById(session.getId()).thenReturn(session))
445+
.flatMap(this::internalDeleteById)
443446
.map((session) -> {
444447
if (message.getChannel().equals(this.sessionDeletedChannel)) {
445448
return new SessionDeletedEvent(this, session);

0 commit comments

Comments
 (0)