@@ -385,10 +385,10 @@ private Mono<RedisSession> getSession(String sessionId, boolean allowExpired) {
385
385
386
386
@ Override
387
387
public Mono <Void > deleteById (String id ) {
388
- return internalDeleteById (id ).then ();
388
+ return deleteAndReturn (id ).then ();
389
389
}
390
390
391
- public Mono <Session > internalDeleteById (String id ) {
391
+ private Mono <RedisSession > deleteAndReturn (String id ) {
392
392
// @formatter:off
393
393
return getSession (id , true )
394
394
.flatMap ((session ) -> this .sessionRedisOperations .delete (getExpiredKey (session .getId ()))
@@ -438,11 +438,13 @@ private Mono<Void> onSessionCreatedChannelMessage(ReactiveSubscription.Message<S
438
438
}
439
439
440
440
private Mono <Void > onKeyDestroyedMessage (ReactiveSubscription .Message <String , String > message ) {
441
- return Mono .just (message .getMessage ()).filter ((key ) -> key .startsWith (getExpiredKeyPrefix ())).map ((key ) -> {
442
- int sessionIdBeginIndex = key .lastIndexOf (":" ) + 1 ;
443
- return key .substring (sessionIdBeginIndex );
444
- })
445
- .flatMap (this ::internalDeleteById )
441
+ // @formatter:off
442
+ return Mono .just (message .getMessage ())
443
+ .filter ((key ) -> key .startsWith (getExpiredKeyPrefix ())).map ((key ) -> {
444
+ int sessionIdBeginIndex = key .lastIndexOf (":" ) + 1 ;
445
+ return key .substring (sessionIdBeginIndex );
446
+ })
447
+ .flatMap (this ::deleteAndReturn )
446
448
.map ((session ) -> {
447
449
if (message .getChannel ().equals (this .sessionDeletedChannel )) {
448
450
return new SessionDeletedEvent (this , session );
@@ -451,6 +453,7 @@ private Mono<Void> onKeyDestroyedMessage(ReactiveSubscription.Message<String, St
451
453
})
452
454
.doOnNext (this ::publishEvent )
453
455
.then ();
456
+ // @formatter:on
454
457
}
455
458
456
459
private void publishEvent (Object event ) {
0 commit comments