run on x86 for a while
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 29s
Build and Publish / BuildAndDeploy (push) Successful in 2m28s

This commit is contained in:
matst80
2024-11-13 08:32:40 +01:00
parent ce5f19d287
commit c9a7113e12
7 changed files with 37 additions and 32 deletions

View File

@@ -13,11 +13,11 @@ type RemoteHost struct {
}
func (h *RemoteHost) IsHealthy() bool {
return !h.Dead && h.MissedPings < 3
return !h.PersistentConnection.Dead && h.MissedPings < 3
}
func (h *RemoteHost) Initialize(p *SyncedPool) {
log.Printf("Initializing remote %s\n", h.Host)
ids, err := h.GetCartMappings()
if err != nil {
log.Printf("Error getting remote mappings: %v\n", err)
@@ -43,8 +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 {
if !h.IsHealthy() {
h.Close()
return fmt.Errorf("remote %s is dead", h.Host)
}
} else {
h.MissedPings = 0