close if not responding
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user