File tree 1 file changed +12
-7
lines changed
spring-web/src/main/java/org/springframework/web/server/session
1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2021 the original author or authors.
2
+ * Copyright 2002-2023 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -229,12 +229,17 @@ public boolean isStarted() {
229
229
230
230
@ Override
231
231
public Mono <Void > changeSessionId () {
232
- String currentId = this .id .get ();
233
- InMemoryWebSessionStore .this .sessions .remove (currentId );
234
- String newId = String .valueOf (idGenerator .generateId ());
235
- this .id .set (newId );
236
- InMemoryWebSessionStore .this .sessions .put (this .getId (), this );
237
- return Mono .empty ();
232
+ return Mono .<Void >defer (() -> {
233
+ String currentId = this .id .get ();
234
+ InMemoryWebSessionStore .this .sessions .remove (currentId );
235
+ String newId = String .valueOf (idGenerator .generateId ());
236
+ this .id .set (newId );
237
+ InMemoryWebSessionStore .this .sessions .put (this .getId (), this );
238
+ return Mono .empty ();
239
+ })
240
+ .subscribeOn (Schedulers .boundedElastic ())
241
+ .publishOn (Schedulers .parallel ())
242
+ .then ();
238
243
}
239
244
240
245
@ Override
You can’t perform that action at this time.
0 commit comments