mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-14 00:16:38 +00:00
Merge pull request #1573 from otrumb/fix/channel-health-failure-kind
fix(channels): clear failure kind after recovery
This commit is contained in:
2 files changed
+4
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user