From 1e6a0996a053f3b88a217748a123d44995d68049 Mon Sep 17 00:00:00 2001 From: lijun Date: Sat, 18 Jan 2025 20:57:39 +0800 Subject: [PATCH] =?UTF-8?q?release=E7=89=88=E6=9C=AC=EF=BC=8C=E8=BE=93?= =?UTF-8?q?=E5=87=BA=E6=AF=8F=E5=B0=8F=E6=97=B6=E4=B8=80=E6=AC=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 0636f90..4857525 100644 --- a/main.go +++ b/main.go @@ -19,10 +19,11 @@ import ( ) var configPath string +var logCount int func main() { fmt.Println("start server") - gin.SetMode(gin.DebugMode) //设置为debug模式 + gin.SetMode(gin.ReleaseMode) //设置为debug模式 r := gin.Default() //数据库初始 err0 := dao.Init() @@ -67,6 +68,7 @@ func init() { } else { configPath = "/home/videoplayer/vp_stream.conf" } + logCount = 0 //读取配置文件 err := proto.ReadConfig(configPath) if err != nil { @@ -101,6 +103,7 @@ func initDeviceGettingStatus() { } func ReadConfigAndSetSystem() { + logCount++ //configPath := "/home/videoplayer/vp_stream.conf" //读取配置文件 err := proto.ReadConfig(configPath) @@ -133,7 +136,9 @@ func ReadConfigAndSetSystem() { log.Printf("device:%d has started!\n", device.ID) } } - log.Println("每10秒执行一次,当前设备:", proto.Config.DeviceInfo) + if logCount%3600 == 0 { + log.Printf("每%d秒执行一次,当前设备:%v", logCount*10, proto.Config.DeviceInfo) + } } func JWTAuthMiddleware() gin.HandlerFunc {