return hosts not ok
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user