降低状态持久化写盘频率

This commit is contained in:
cppla
2026-08-10 15:17:46 +08:00
parent 1ce8d9c337
commit a6030d2008
5 changed files with 157 additions and 36 deletions
-3
View File
@@ -176,7 +176,6 @@ func (a *App) connectAgent(username, password string, conn net.Conn, family int)
node.Pong = false
node.Online4 = family == 4
node.Online6 = family == 6
a.wakeStatsWriter()
return id, append([]MonitorConfig(nil), a.runtime.Monitors...), nil
}
@@ -194,7 +193,6 @@ func (a *App) disconnectAgent(username string, conn net.Conn, connectionID uint6
node.HasUpdate = false
node.Pong = false
a.nodeMu.Unlock()
a.wakeStatsWriter()
time.AfterFunc(25*time.Second, func() {
if a.ctx.Err() != nil {
return
@@ -226,7 +224,6 @@ func (a *App) updateAgent(username string, connectionID uint64, update AgentStat
node.HasUpdate = true
node.LastUpdate = time.Now()
a.nodeMu.Unlock()
a.wakeStatsWriter()
a.evaluateWatchdogs(username, false)
return true
}