Some fixes

This commit is contained in:
Derek Chiang 2015-04-16 16:54:29 -04:00 committed by James Phillips
parent a338e5efe8
commit a1854a7614
1 changed files with 4 additions and 4 deletions

View File

@ -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: