From c7fa763ad359cd1374777d0705495c36157f03b2 Mon Sep 17 00:00:00 2001 From: LaoK996 <2388405897@qq.com> Date: Thu, 29 Nov 2018 19:34:38 +0800 Subject: [PATCH] Update ch5-10-service-discovery.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 还没写完呢? --- ch5-web/ch5-10-service-discovery.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ch5-web/ch5-10-service-discovery.md b/ch5-web/ch5-10-service-discovery.md index ab444a4..aef1219 100644 --- a/ch5-web/ch5-10-service-discovery.md +++ b/ch5-web/ch5-10-service-discovery.md @@ -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)