mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-11 12:18:59 +00:00
fix(channels): clear failure kind after recovery
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
1 parent
4f80824177
commit
dcadb77548
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