Skip to content

Commit

Permalink
fix: driver heartbeat
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Jul 28, 2023
1 parent 2b719f2 commit 3023a1d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions driver/wsclient.go
Expand Up @@ -125,10 +125,10 @@ func (ws *WSClient) Listen(handler func([]byte, zero.APICaller)) {
}
continue
}
if rsp.Get("meta_event_type").Str != "heartbeat" { // 忽略心跳事件
log.Debug("[ws] 接收到事件: ", helper.BytesToString(payload))
if rsp.Get("meta_event_type").Str == "heartbeat" { // 忽略心跳事件
continue
}
log.Debug("[ws] 接收到事件: ", helper.BytesToString(payload))
handler(payload, ws)
}
}
Expand Down
4 changes: 2 additions & 2 deletions driver/wsserver.go
Expand Up @@ -196,10 +196,10 @@ func (wssc *WSSCaller) listen(handler func([]byte, zero.APICaller)) {
}
continue
}
if rsp.Get("meta_event_type").Str != "heartbeat" { // 忽略心跳事件
log.Debug("[wss] 接收到事件: ", helper.BytesToString(payload))
if rsp.Get("meta_event_type").Str == "heartbeat" { // 忽略心跳事件
continue
}
log.Debug("[wss] 接收到事件: ", helper.BytesToString(payload))
handler(payload, wssc)
}
}
Expand Down

0 comments on commit 3023a1d

Please sign in to comment.