From 07cb9515be95eff3d3ec45796755ac1d15795e9b Mon Sep 17 00:00:00 2001 From: lijun Date: Mon, 20 Jan 2025 18:49:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8v3=E8=8E=B7=E5=8F=96=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E5=B8=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/tool.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/handler/tool.go b/handler/tool.go index e09ec04..bd382c3 100644 --- a/handler/tool.go +++ b/handler/tool.go @@ -213,6 +213,7 @@ func subscribeAndHandleMessagesV3(ws *websocket.Conn, device_id int) { count := 0 //定时器,发送计数器 t_count := 0 + t := 0 for { //从service获取当前帧 img, c := service.GetDeviceCurrentFrameV3(device_id) @@ -246,7 +247,8 @@ func subscribeAndHandleMessagesV3(ws *websocket.Conn, device_id int) { if err5 != nil { log.Printf("img close err:%v", err) } else { - if c%10 == 0 { + t++ + if t%10 == 0 { log.Printf("device:%d send frame count:%d,img is closed", device_id, c) } }