From 31702fe7fb4a4576daf0420539ff3ccc1216c6fe Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Fri, 03 Dec 2021 17:07:57 +0800
Subject: [PATCH] fix rabbitmq

---
 src/main/java/com/xcong/excoin/websocket/handler/FishHitWebSocketHandler.java |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/websocket/handler/FishHitWebSocketHandler.java b/src/main/java/com/xcong/excoin/websocket/handler/FishHitWebSocketHandler.java
index 87165a6..2d242e5 100644
--- a/src/main/java/com/xcong/excoin/websocket/handler/FishHitWebSocketHandler.java
+++ b/src/main/java/com/xcong/excoin/websocket/handler/FishHitWebSocketHandler.java
@@ -110,9 +110,12 @@
 
     @Override
     public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception {
+        log.info("离开websocket");
         Long memberId = SID_MID.get(session.getId());
 
+        if (memberId != null) {
+            MEMBER_SESSIONS.remove(memberId);
+        }
         SID_MID.remove(session.getId());
-        MEMBER_SESSIONS.remove(memberId);
     }
 }

--
Gitblit v1.9.1