mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-08 18:23:45 +08:00
opt: close unused websocket connections
This commit is contained in:
@@ -137,6 +137,7 @@ func (h *ChatHandler) ChatHandle(c *gin.Context) {
|
||||
for {
|
||||
_, msg, err := client.Receive()
|
||||
if err != nil {
|
||||
logger.Debugf("close connection: %s", client.Conn.RemoteAddr())
|
||||
client.Close()
|
||||
h.App.ChatClients.Delete(sessionId)
|
||||
h.App.ChatSession.Delete(sessionId)
|
||||
|
||||
Reference in New Issue
Block a user