fix(ws_handler): update readPump to prevent closing client.Quit prematurely
All checks were successful
Build Backend / build (push) Successful in 12m50s
Build Backend / build-docker (push) Successful in 1m12s

- 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.
This commit is contained in:
lafay
2026-03-26 21:47:49 +08:00
parent 359e624e7c
commit ebebbbc165

View File

@@ -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