From 6bdaeaf01734d41339234136dcccbf5d15a12509 Mon Sep 17 00:00:00 2001 From: lijun Date: Thu, 23 Jan 2025 23:03:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=BD=93=E5=89=8D=E5=B8=A7by?= =?UTF-8?q?tes,=E5=9E=83=E5=9C=BE=E5=9B=9E=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- handler/tool.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/handler/tool.go b/handler/tool.go index ffa136e..868555f 100644 --- a/handler/tool.go +++ b/handler/tool.go @@ -11,6 +11,7 @@ import ( "io" "log" "net/http" + "runtime" "strconv" "time" ) @@ -230,4 +231,7 @@ func subscribeAndHandleMessagesV3(ws *websocket.Conn, deviceId int) { worker.SetRedisWithExpire(strconv.Itoa(deviceId)+"_is_play", "1", time.Minute*5) log.Printf("device_id: %d has set is_play to 0", deviceId) } + + //垃圾回收 + runtime.GC() }