close if not responding
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 27s
Build and Publish / BuildAndDeploy (push) Successful in 2m16s

This commit is contained in:
matst80
2024-11-12 22:52:00 +01:00
parent c2ae713b46
commit 42c6536cd6

View File

@@ -43,7 +43,9 @@ func (h *RemoteHost) Ping() error {
if err != nil {
h.MissedPings++
log.Printf("Error pinging remote %s, missed pings: %d", h.Host, h.MissedPings)
if h.MissedPings >= 3 {
h.Close()
}
} else {
h.MissedPings = 0
}