1
0
mirror of https://github.com/chai2010/advanced-go-programming-book.git synced 2025-05-24 12:32:21 +00:00

Update ch5-10-service-discovery.md

还没写完呢?
This commit is contained in:
LaoK996 2018-11-29 19:34:38 +08:00 committed by GitHub
parent d09ec610ce
commit c7fa763ad3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,7 +84,7 @@ node := getNodeFromPool()
resp, err := remoteRPC(ctx, params)
if err != nil {
if err == nil {
node.Vote(status.Healthy)
} else {
node.Vote(status.Unhealthy)
@ -103,9 +103,10 @@ healthcheck := func(endpoint string) {
resp, err := callRemoteHealthcheckAPI(endpoint)
if err != nil {
dropThisAPINode()
break
}
}
}
}()
for _, endpoint := range endpointList {
go healthcheck(endpoint)