From ebebbbc1657f08f4329529c79609bc66f97d6eae Mon Sep 17 00:00:00 2001 From: lafay <2021211506@stu.hit.edu.cn> Date: Thu, 26 Mar 2026 21:47:49 +0800 Subject: [PATCH] fix(ws_handler): update readPump to prevent closing client.Quit prematurely - Added comments to clarify that the client.Quit channel should not be closed within the readPump function, as it is managed by Hub.Unregister. This change improves code safety and maintainability. --- internal/handler/ws_handler.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/handler/ws_handler.go b/internal/handler/ws_handler.go index 61adf5b..4857724 100644 --- a/internal/handler/ws_handler.go +++ b/internal/handler/ws_handler.go @@ -132,7 +132,6 @@ func (h *WSHandler) HandleWebSocket(c *gin.Context) { func (h *WSHandler) readPump(conn *websocket.Conn, client *ws.Client) { defer func() { conn.Close() - close(client.Quit) }() conn.SetReadLimit(64 * 1024) // 64KB