watcher: send the inconsistency alert once per disagreement (closes #158)
check / check (push) Successful in 57s
check / check (push) Successful in 57s
detectInconsistencies alerted for every neighbouring pair of nameservers whose records differed, on every DNS check, for as long as they differed. It now also takes the previous hostname state and alerts for a pair only when both nameservers were in that state with equal records. The state loaded at startup is the previous state for the first check, so a disagreement saved before a restart is not reported again. The choice of pairs is in newlyDisagreeingPairs, tested on record data built in the test. The README describes the new behaviour. Model: opus-5-5
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package watcher
|
||||
|
||||
import "sneak.berlin/go/dnswatcher/internal/state"
|
||||
|
||||
// NewlyDisagreeingPairs exports newlyDisagreeingPairs for testing.
|
||||
func NewlyDisagreeingPairs(
|
||||
prev *state.HostnameState,
|
||||
current map[string]map[string][]string,
|
||||
) [][2]string {
|
||||
return newlyDisagreeingPairs(prev, current)
|
||||
}
|
||||
Reference in New Issue
Block a user