return hosts not ok
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 29s
Build and Publish / BuildAndDeploy (push) Successful in 2m26s

This commit is contained in:
matst80
2024-11-14 08:36:04 +01:00
parent d5bfb87b68
commit 8bbe3a6f51

View File

@@ -93,7 +93,15 @@ func (p *SyncedPool) NegotiateHandler(data *FrameWithPayload, resultChan chan<-
go p.AddRemote(host) go p.AddRemote(host)
} }
resultChan <- MakeFrameWithPayload(RemoteNegotiateResponse, 200, []byte("ok")) p.mu.RLock()
defer p.mu.RUnlock()
hosts := make([]string, 0, len(p.remotes))
for _, r := range p.remotes {
if r.IsHealthy() {
hosts = append(hosts, r.Host)
}
}
resultChan <- MakeFrameWithPayload(RemoteNegotiateResponse, 200, []byte(strings.Join(hosts, ";")))
return nil return nil
} }