Reset count to 0 even if it was low Otherwise we'll just go straight to sending the error next time instead of waiting for two.
1 files changed, 1 insertions(+), 1 deletions(-) M cmd/cron/main.go
M cmd/cron/main.go => cmd/cron/main.go +1 -1
@@ 102,9 102,9 @@ func main() { publish(host, fmt.Sprintf("Certificate check failed for %s: possible MITM or you changed your public key", host)) } else { log.Printf("Success for %s\n", host) rclient.HSet(context.Background(), "mitm_monitor_hosts", host, 0) errCountI, _ := strconv.Atoi(errCount) if errCountI > 1 { rclient.HSet(context.Background(), "mitm_monitor_hosts", host, 0) publish(host, fmt.Sprintf("Certificate checks passed for %s", host)) } }