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