release版本,输出每小时一次

This commit is contained in:
lijun 2025-01-18 20:57:39 +08:00
parent f86c1fd3a4
commit 1e6a0996a0
1 changed files with 7 additions and 2 deletions

View File

@ -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 {