Browse Source

Merge pull request #4104 from xiang90/ctl

etcdctl: fix syncWithPeerAPI by breaking the loop when there is no error
Xiang Li 10 năm trước cách đây
mục cha
commit
c8a0cc80dc
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      etcdctl/command/util.go

+ 2 - 2
etcdctl/command/util.go

@@ -348,8 +348,8 @@ func syncWithPeerAPI(c *cli.Context, ctx context.Context, knownPeers []string) (
 		}
 		body, err = ioutil.ReadAll(resp.Body)
 		resp.Body.Close()
-		if err != nil {
-			continue
+		if err == nil {
+			break
 		}
 	}
 	if err != nil {