Unverified Commit daf59c75 authored by gaoyan's avatar gaoyan Committed by GitHub

[Optimized ]Optimized sse connect (#3193)

parent 51b9c0c0
......@@ -67,10 +67,8 @@ public class SseSessionContextHolder {
*/
public static SseEmitter connectSession(String sessionKey) {
log.debug("New session wants to connect: {}", sessionKey);
if (exists(sessionKey)) {
log.warn("Session key already exists: {}", sessionKey);
closeSse(sessionKey);
}
log.warn("Session key already exists: {},replace it", sessionKey);
SseEmitter sseEmitter = new SseEmitter(60 * 1000L * 10);
sseEmitter.onError(err -> onError(sessionKey, err));
sseEmitter.onTimeout(() -> onTimeout(sessionKey));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment