close if not responding
This commit is contained in:
@@ -43,7 +43,9 @@ func (h *RemoteHost) Ping() error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
h.MissedPings++
|
h.MissedPings++
|
||||||
log.Printf("Error pinging remote %s, missed pings: %d", h.Host, h.MissedPings)
|
log.Printf("Error pinging remote %s, missed pings: %d", h.Host, h.MissedPings)
|
||||||
|
if h.MissedPings >= 3 {
|
||||||
|
h.Close()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
h.MissedPings = 0
|
h.MissedPings = 0
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user