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() }