feat(node): add GetNodeCount to get node count and remove no need node update log, only log when node count changed
Build / ubuntu-latest (push) Failing after 3m17s
Build / windows-latest (push) Canceled after 8m6s

This commit is contained in:
2026-09-29 21:43:46 +08:00
parent c7642ecca5
commit aa7e7f87e1
6 changed files with 23 additions and 9 deletions
+4
View File
@@ -260,11 +260,15 @@ func startBackgroundTasks(_ *config.Config) {
if client == nil {
continue
}
orgNodeCount := node.GetTracker().GetNodeCount()
nodes, err := client.FetchNodes()
if err != nil {
postLog.Warning("Failed to refresh node list: " + err.Error())
continue
}
if node.GetTracker().GetNodeCount() != orgNodeCount {
postLog.Info(fmt.Sprintf("Refreshed node list: %d nodes", len(nodes)))
}
tracker := node.GetTracker()
if tracker != nil {
tracker.UpdateNodeList(komari.BuildNodeListData(nodes))