From 96689a49b8137cc0253cc974113b14fea9a46358 Mon Sep 17 00:00:00 2001 From: NoahLan <6995syu@163.com> Date: Thu, 14 Sep 2023 15:20:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4ws=E5=BF=83=E8=B7=B3?= =?UTF-8?q?=E7=9A=84=E9=AA=8C=E8=AF=81=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- middleware/heartbeat_ws.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/middleware/heartbeat_ws.go b/middleware/heartbeat_ws.go index fa385ea..fba8490 100644 --- a/middleware/heartbeat_ws.go +++ b/middleware/heartbeat_ws.go @@ -45,11 +45,11 @@ func WithHeartbeatWS(interval time.Duration, hbdFn WsHeartbeatFn) nnet.RunOption break } - deadline := time.Now().Add(-2 * m.interval).Unix() - if atomic.LoadInt64(&m.lastAt) < deadline { - nlog.Errorf("Heartbeat timeout, LastTime=%d, Deadline=%d", atomic.LoadInt64(&m.lastAt), deadline) - break - } + //deadline := time.Now().Add(-2 * m.interval).Unix() + //if atomic.LoadInt64(&m.lastAt) < deadline { + // nlog.Errorf("Heartbeat timeout, LastTime=%d, Deadline=%d", atomic.LoadInt64(&m.lastAt), deadline) + // break + //} err := m.hbdFn(nc.WsConn()) if err != nil {