From 1110ca1b9c2a88401d01279ec309fedd4bc4776d Mon Sep 17 00:00:00 2001 From: lijun Date: Wed, 22 Jan 2025 14:22:15 +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 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/handler/tool.go b/handler/tool.go index 99ff9fe..7b980c0 100644 --- a/handler/tool.go +++ b/handler/tool.go @@ -213,15 +213,10 @@ func subscribeAndHandleMessagesV3(ws *websocket.Conn, device_id int) { //定时器,发送计数器 t_count := 0 t := 0 - log.Printf("device:%d send frame count:%d,img is closed", device_id, count) //计算帧率 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) @@ -252,6 +247,10 @@ func subscribeAndHandleMessagesV3(ws *websocket.Conn, device_id int) { if err5 != nil { log.Printf("img close err:%v", err) } + t++ + if t%50 == 0 { + log.Printf("device:%d send frame count:%d,img is closed", device_id, c) + } } } else { //每秒发送一次心跳检测