Fix this cruft

This commit is contained in:
Asim 2016-01-26 20:44:29 +00:00
parent 822cc0e5da
commit cd13f0389f

View File

@ -7,7 +7,6 @@ import (
"fmt"
"net"
"net/http"
"os"
"runtime"
"time"
@ -159,7 +158,15 @@ func (c *consulRegistry) Deregister(s *Service) error {
if len(s.Nodes) == 0 {
return errors.New("Require at least one node")
}
return c.Client.Agent().ServiceDeregister(s.Nodes[0].Id)
node := s.Nodes[0]
_, err := c.Client.Catalog().Deregister(&consul.CatalogDeregistration{
Node: node.Id,
Address: node.Address,
ServiceID: node.Id,
}, nil)
return err
}
func (c *consulRegistry) Register(s *Service) error {