fix 修复 sse关闭 用户id或token为空报错问题
This commit is contained in:
parent
b528f0bd14
commit
0937093851
@ -65,6 +65,9 @@ public class SseEmitterManager {
|
|||||||
* @param token 用户的唯一令牌,用于识别具体的连接
|
* @param token 用户的唯一令牌,用于识别具体的连接
|
||||||
*/
|
*/
|
||||||
public void disconnect(Long userId, String token) {
|
public void disconnect(Long userId, String token) {
|
||||||
|
if (userId == null || token == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
Map<String, SseEmitter> emitters = USER_TOKEN_EMITTERS.get(userId);
|
Map<String, SseEmitter> emitters = USER_TOKEN_EMITTERS.get(userId);
|
||||||
if (MapUtil.isNotEmpty(emitters)) {
|
if (MapUtil.isNotEmpty(emitters)) {
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user