mirror of https://github.com/status-im/consul.git
Some fixes
This commit is contained in:
parent
a338e5efe8
commit
a1854a7614
|
@ -569,24 +569,24 @@ func (a *Agent) SendCoordinates(shutdownCh chan struct{}) {
|
||||||
timer := time.After(intv)
|
timer := time.After(intv)
|
||||||
select {
|
select {
|
||||||
case <-timer:
|
case <-timer:
|
||||||
var c coordinate.Coordinate
|
var c *coordinate.Coordinate
|
||||||
if a.config.Server {
|
if a.config.Server {
|
||||||
c = a.server.GetLANCoordinate()
|
c = a.server.GetLANCoordinate()
|
||||||
} else {
|
} else {
|
||||||
c = a.client.GetCoordinate()
|
c = a.client.GetCoordinate()
|
||||||
}
|
}
|
||||||
req := structs.CoordinateUpdateRequest{
|
req := structs.CoordinateUpdateRequest{
|
||||||
NodeSpecificRequest: NodeSpecificRequest{
|
NodeSpecificRequest: structs.NodeSpecificRequest{
|
||||||
Datacenter: a.config.Datacenter,
|
Datacenter: a.config.Datacenter,
|
||||||
Node: a.config.NodeName,
|
Node: a.config.NodeName,
|
||||||
},
|
},
|
||||||
Op: structs.CoordinateSet,
|
Op: structs.CoordinateSet,
|
||||||
Coord: c,
|
Coord: c,
|
||||||
QueryOptions: structs.QueryOptions{Token: a.config.ACLToken},
|
WriteRequest: structs.WriteRequest{Token: a.config.ACLToken},
|
||||||
}
|
}
|
||||||
|
|
||||||
var reply struct{}
|
var reply struct{}
|
||||||
if err := a.RPC("Coordinate.Update", &arg, &reply); err != nil {
|
if err := a.RPC("Coordinate.Update", &req, &reply); err != nil {
|
||||||
a.logger.Printf("[ERR] coordinate update error: %s", err.Error())
|
a.logger.Printf("[ERR] coordinate update error: %s", err.Error())
|
||||||
}
|
}
|
||||||
case <-shutdownCh:
|
case <-shutdownCh:
|
||||||
|
|
Loading…
Reference in New Issue