Merge pull request #1573 from otrumb/fix/channel-health-failure-kind

fix(channels): clear failure kind after recovery
This commit is contained in:
Clark Cant authored and GitHub committed 2026-09-26 04:02:42 +07:00
commit 0b1aeef52c
2 files changed
+4

No files matched your search

+1
View File
@@ -304,6 +304,7 @@ func mergeChannelHealth(previous, snapshot ChannelHealth) ChannelHealth {
}
snapshot.ConsecutiveFailures = 0
snapshot.FirstFailedAt = time.Time{}
snapshot.FailureKind = ""
if snapshot.LastFailedAt.IsZero() {
snapshot.LastFailedAt = previous.LastFailedAt
}
+3
View File
@@ -504,6 +504,9 @@ func TestMergeChannelHealthTracksFailureTimelineAndRecovery(t *testing.T) {
recovered.CheckedAt = recoveredAt
recovered = mergeChannelHealth(second, recovered)
if recovered.FailureKind != "" {
t.Fatalf("expected failure kind to clear after recovery, got %q", recovered.FailureKind)
}
if recovered.ConsecutiveFailures != 0 {
t.Fatalf("expected consecutive failures reset, got %d", recovered.ConsecutiveFailures)
}