fix
This commit is contained in:
parent
c523a5a7c6
commit
4c50131761
@ -322,10 +322,14 @@ func (w *wsConnectItem) heartbeat() {
|
|||||||
w.debug = nil
|
w.debug = nil
|
||||||
}
|
}
|
||||||
//发送心跳信息
|
//发送心跳信息
|
||||||
if err := w.conn.WriteMessage(websocket.PongMessage, w.respondDataFormat(constants.WEBSOCKET_HEARTBEAT, websocket_data.HeartBeatMsg{
|
var d interface{}
|
||||||
|
if w.debug != nil {
|
||||||
|
d = websocket_data.HeartBeatMsg{
|
||||||
WsCount: currentWebsocketConnectCount,
|
WsCount: currentWebsocketConnectCount,
|
||||||
CombineCount: currentRequestCombineApiCount,
|
CombineCount: currentRequestCombineApiCount,
|
||||||
})); err != nil {
|
}
|
||||||
|
}
|
||||||
|
if err := w.conn.WriteMessage(websocket.PongMessage, w.respondDataFormat(constants.WEBSOCKET_HEARTBEAT, d)); err != nil {
|
||||||
logx.Error("发送心跳信息异常,关闭连接:", w.uniqueId, err)
|
logx.Error("发送心跳信息异常,关闭连接:", w.uniqueId, err)
|
||||||
w.close()
|
w.close()
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user