Skip to content

Commit da75e33

Browse files
committed
skip unhealthy clients
1 parent 872d698 commit da75e33

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apiserver/api/api.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ func (a *api) gatewayConfig(w http.ResponseWriter, r *http.Request) {
3434

3535
peers := make([]Peer, 0)
3636
for _, client := range clients {
37-
peers = append(peers, Peer{PublicKey: client.PublicKey, IP: client.IP})
37+
if *client.Healthy {
38+
peers = append(peers, Peer{PublicKey: client.PublicKey, IP: client.IP})
39+
} else {
40+
log.Tracef("Skipping unhealthy client: %s", client.Serial)
41+
}
3842
}
3943

4044
w.WriteHeader(http.StatusOK)

0 commit comments

Comments
 (0)