Skip to content

Commit 2f0be72

Browse files
committed
Merge branch '3.4.x'
- SessionEventRegistry doneWaiting if result found Issue gh-3398
2 parents 6eef58f + e74116d commit 2f0be72

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-session-data-redis/src/integration-test/java/org/springframework/session/data/SessionEventRegistry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ public class SessionEventRegistry implements ApplicationListener<AbstractSession
3838
@Override
3939
public void onApplicationEvent(AbstractSessionEvent event) {
4040
String sessionId = event.getSessionId();
41-
this.events.computeIfAbsent(sessionId, (key) -> new ArrayList<>()).add(event);
4241
Object lock = getLock(sessionId);
4342
synchronized (lock) {
43+
this.events.computeIfAbsent(sessionId, (key) -> new ArrayList<>()).add(event);
4444
lock.notifyAll();
4545
}
4646
}
@@ -72,7 +72,7 @@ public <E extends AbstractSessionEvent> E waitForEvent(String sessionId, Class<E
7272
lock.wait(waitInMs);
7373
}
7474
long now = System.currentTimeMillis();
75-
doneWaiting = (now - start) >= waitInMs;
75+
doneWaiting = result != null || (now - start) >= waitInMs;
7676
}
7777
return getEvent(sessionId, type);
7878
}

0 commit comments

Comments
 (0)