fix: agent ws connect panic

This commit is contained in:
engigu
2026-01-01 12:36:50 +08:00
parent 1c3b153742
commit 24159fda62
2 changed files with 19 additions and 2 deletions
+1 -2
View File
@@ -413,9 +413,8 @@ func (c *AgentController) wsReadPump(ac *services.AgentConnection, agent *models
c.wsManager.Unregister(agent.ID)
}()
// 检查连接是否有效
// 检查连接是否有效(可能是旧连接被新连接替换)
if ac == nil || ac.IsClosed() {
logger.Warnf("[AgentWS] Agent #%d 连接无效", agent.ID)
return
}