From c0219ce83c1eb4fc5880b43c217f85d9c6fbd7f4 Mon Sep 17 00:00:00 2001 From: lijun Date: Wed, 22 Jan 2025 13:57:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F=E8=A7=A3?= =?UTF-8?q?=E5=86=B3=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/tool.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/handler/tool.go b/handler/tool.go index 87decff..3497490 100644 --- a/handler/tool.go +++ b/handler/tool.go @@ -218,6 +218,10 @@ func subscribeAndHandleMessagesV3(ws *websocket.Conn, device_id int) { for { //从service获取当前帧 img, c := service.GetDeviceCurrentFrameV3(device_id) + t++ + if t%10 == 0 { + log.Printf("device:%d send frame count:%d,img is closed", device_id, c) + } if c != count { if c == -1 { log.Printf("device:%d get frame err!", device_id) @@ -235,10 +239,6 @@ func subscribeAndHandleMessagesV3(ws *websocket.Conn, device_id int) { worker.SetRedisSetRemove(online_conn_key, con_id) break } - t++ - if t%10 == 0 { - log.Printf("device:%d send frame count:%d,img is closed", device_id, c) - } buf1 := buf.GetBytes() err2 := ws.WriteMessage(websocket.BinaryMessage, buf1)