fix: 修复应用日志异常膨胀

This commit is contained in:
ryan
2026-06-21 10:21:18 +08:00
parent a343c7a605
commit b12a9b0185
12 changed files with 358 additions and 53 deletions
+15
View File
@@ -203,3 +203,18 @@ func updateSnapshotFromApplyOutcome(mode string, snapshot *state.Snapshot, confi
}
return result
}
func snapshotMatchesTarget(snapshot *state.Snapshot, version string, checksum string) bool {
if snapshot == nil {
return false
}
return strings.TrimSpace(snapshot.CurrentVersion) == strings.TrimSpace(version) &&
strings.TrimSpace(snapshot.CurrentChecksum) == strings.TrimSpace(checksum)
}
func shouldReportApplyLog(alreadySynced bool, result string) bool {
if result != ApplyResultSuccess {
return true
}
return !alreadySynced
}