perf(日志): 空轮询时不输出 Info 日志以减少噪音

Motivation:
轮询安全网关更新时,绝大多数周期没有新消息,持续输出 Info 日志会产生大量噪音并带来不必要的开销。仅在确有更新时才记录日志,便于聚焦真实事件。

Changes:

* 仅在存在更新时输出 getUpdates 日志
* 仅在拉取到群聊数据时输出 poll 日志
This commit is contained in:
2026-08-15 18:19:41 +08:00
parent 6bdd3eb786
commit 0210b70bda
2 changed files with 6 additions and 2 deletions
+3 -1
View File
@@ -178,7 +178,9 @@ func (s *SafeWSender) PollGroupChats(token string, offset int64, timeout int) ([
if maxID > 0 {
next = maxID + 1
}
slog.Info("safew getUpdates", "timeout", timeout, "updates", n, "groups", len(chats), "offset", next)
if n > 0 {
slog.Info("safew getUpdates", "timeout", timeout, "updates", n, "groups", len(chats), "offset", next)
}
return chats, next, nil
}