wecisecode 1 день назад
Родитель
Сommit
7003101ac0
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      odbctest/odbcmql/cfglog.go

+ 2 - 1
odbctest/odbcmql/cfglog.go

@@ -17,7 +17,8 @@ func init() {
 	pprofpath := config.GetString("pprof")
 	pprofpath := config.GetString("pprof")
 	if pprofpath != "" {
 	if pprofpath != "" {
 		go func() {
 		go func() {
-			for {
+			t := time.NewTicker(1 * time.Minute)
+			for range t.C {
 				selfmonitor.MemoryInfoCapture(pprofpath, 1*time.Minute)
 				selfmonitor.MemoryInfoCapture(pprofpath, 1*time.Minute)
 				(&mio.ClearFiles{Dir: pprofpath, NameMatch: `^.*\.prof$`, KeepLast: 10}).Do()
 				(&mio.ClearFiles{Dir: pprofpath, NameMatch: `^.*\.prof$`, KeepLast: 10}).Do()
 			}
 			}