mirror of
https://github.com/jkstack/libagent.git
synced 2025-12-24 12:11:57 +08:00
修正监控频率设置过低时CPU占用率过高的问题
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user