bump(github.com/coreos/go-etcd): 460022c1238ee0913013936e3486f41a3c7c1d7a
This commit is contained in:
@ -123,12 +123,19 @@ func (c *Client) internalSyncCluster(machines []string) bool {
|
|||||||
continue
|
continue
|
||||||
} else {
|
} else {
|
||||||
b, err := ioutil.ReadAll(resp.Body)
|
b, err := ioutil.ReadAll(resp.Body)
|
||||||
|
resp.Body.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// try another machine in the cluster
|
// try another machine in the cluster
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// update Machines List
|
// update Machines List
|
||||||
c.cluster.Machines = strings.Split(string(b), ",")
|
c.cluster.Machines = strings.Split(string(b), ",")
|
||||||
|
|
||||||
|
// update leader
|
||||||
|
// the first one in the machine list is the leader
|
||||||
|
logger.Debugf("update.leader[%s,%s]", c.cluster.Leader, c.cluster.Machines[0])
|
||||||
|
c.cluster.Leader = c.cluster.Machines[0]
|
||||||
|
|
||||||
logger.Debug("sync.machines ", c.cluster.Machines)
|
logger.Debug("sync.machines ", c.cluster.Machines)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@ -139,6 +146,7 @@ func (c *Client) internalSyncCluster(machines []string) bool {
|
|||||||
// serverName should contain both hostName and port
|
// serverName should contain both hostName and port
|
||||||
func (c *Client) createHttpPath(serverName string, _path string) string {
|
func (c *Client) createHttpPath(serverName string, _path string) string {
|
||||||
httpPath := path.Join(serverName, _path)
|
httpPath := path.Join(serverName, _path)
|
||||||
|
httpPath = c.config.Scheme + "://" + httpPath
|
||||||
return httpPath
|
return httpPath
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user