mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-05 15:26:36 +08:00
fix(agent): clear sticky LastError on successful sync paths
Pages reconcile could succeed while agent state retained a previous network error, so health events stayed active indefinitely. Clear LastError whenever sync completes successfully without re-applying config, and cover the paths with regression tests.
This commit is contained in:
@@ -122,6 +122,8 @@ func (s *Service) syncMismatchedChecksum(ctx context.Context, mode string, start
|
||||
if !reconciled {
|
||||
slog.Debug("skipping config fetch because state already records target version/checksum", "version", target.Version, "checksum", target.Checksum)
|
||||
}
|
||||
// Successful reconcile must clear sticky LastError so health events can resolve.
|
||||
snapshot.LastError = ""
|
||||
return s.stateStore.Save(snapshot)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user