This commit is contained in:
laodaming 2023-10-18 15:10:45 +08:00
parent 379230dd39
commit 6de13a61f7

View File

@ -323,6 +323,10 @@ func (w *wsConnectItem) heartbeat() {
w.close()
return
}
//查看debug的时间是否过期
if w.debug != nil && w.debug.Exp != nil && *w.debug.Exp < time.Now().UTC().Unix() {
w.debug = nil
}
//发送心跳信息
if err := w.conn.WriteMessage(websocket.PongMessage, nil); err != nil {
logx.Error("发送心跳信息异常,关闭连接:", w.uniqueId, err)