Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,17 @@ private Mono<RedisSession> getSession(String sessionId, boolean allowExpired) {

@Override
public Mono<Void> deleteById(String id) {
return internalDeleteById(id).then();
}

public Mono<Session> internalDeleteById(String id) {
// @formatter:off
return getSession(id, true)
.flatMap((session) -> this.sessionRedisOperations.delete(getExpiredKey(session.getId()))
.thenReturn(session))
.flatMap((session) -> this.sessionRedisOperations.delete(getSessionKey(session.getId())).thenReturn(session))
.flatMap((session) -> this.indexer.delete(session.getId()).thenReturn(session))
.flatMap((session) -> this.expirationStore.remove(session.getId()));
.flatMap((session) -> this.expirationStore.remove(session.getId()).thenReturn(session));
// @formatter:on
}

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