mirror of https://github.com/halo-dev/halo
refactor: original should be removed when session id changed (#5931)
#### What type of PR is this? /kind improvement /area core #### What this PR does / why we need it: 当 session id 改变时清除原来的 session id 记录 #### Does this PR introduce a user-facing change? ```release-note None ```pull/5950/head
parent
607898b172
commit
9c98d0a54c
|
@ -98,6 +98,12 @@ public class InMemoryReactiveIndexedSessionRepository extends ReactiveMapSession
|
|||
|
||||
Mono<Void> updateIndex(MapSession session) {
|
||||
return removeIndex(session.getId())
|
||||
.then(Mono.defer(() -> {
|
||||
if (!session.getId().equals(session.getOriginalId())) {
|
||||
return removeIndex(session.getOriginalId());
|
||||
}
|
||||
return Mono.empty();
|
||||
}))
|
||||
.then(Mono.defer(() -> {
|
||||
indexResolver.resolveIndexesFor(session)
|
||||
.forEach((name, value) -> {
|
||||
|
|
Loading…
Reference in New Issue