From 42c6536cd67eac2668176f823624f08e099fdefa Mon Sep 17 00:00:00 2001 From: matst80 Date: Tue, 12 Nov 2024 22:52:00 +0100 Subject: [PATCH] close if not responding --- remote-host.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/remote-host.go b/remote-host.go index 88e2837..5bb33c4 100644 --- a/remote-host.go +++ b/remote-host.go @@ -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 }