修正监控频率设置过低时CPU占用率过高的问题

This commit is contained in:
lwch
2023-08-17 15:52:01 +08:00
parent 88d1ef5713
commit c98ad2e329

View File

@@ -8,9 +8,13 @@ import (
"time"
"github.com/jkstack/anet"
"github.com/jkstack/jkframe/utils"
)
func (app *app) report() {
if app.a.Configure().Monitor.Interval <= 0 {
app.a.Configure().Monitor.Interval = utils.Duration(5 * time.Second)
}
for {
time.Sleep(app.a.Configure().Monitor.Interval.Duration())
if !app.connected {