diff --git a/registry/consul_registry.go b/registry/consul_registry.go index d95670db..e98edbf3 100644 --- a/registry/consul_registry.go +++ b/registry/consul_registry.go @@ -200,17 +200,10 @@ func (c *consulRegistry) GetService(name string) ([]*Service, error) { // address is service address address := s.Service.Address - // if we can't get the new type of version + // if we can't get the version we bail // use old the old ways if !found { - // id was set as node - id = s.Node.Node - // key was service id - key = s.Service.ID - // version was service id - version = s.Service.ID - // address was address - address = s.Node.Address + continue } svc, ok := serviceMap[key] diff --git a/registry/consul_watcher.go b/registry/consul_watcher.go index 0327f5af..8e1cb8e4 100644 --- a/registry/consul_watcher.go +++ b/registry/consul_watcher.go @@ -62,17 +62,9 @@ func (cw *consulWatcher) serviceHandler(idx uint64, data interface{}) { // address is service address address := e.Service.Address - // if we can't get the new type of version - // use old the old ways + // if we can't get the version we bail if !found { - // id was set as node - id = e.Node.Node - // key was service id - key = e.Service.ID - // version was service id - version = e.Service.ID - // address was address - address = e.Node.Address + continue } svc, ok := serviceMap[key] @@ -156,7 +148,7 @@ func (cw *consulWatcher) serviceHandler(idx uint64, data interface{}) { for _, old := range rservices[serviceName] { // old version does not exist in new version map // kill it with fire! - if _, ok := serviceMap[serviceName+old.Version]; !ok { + if _, ok := serviceMap[old.Version]; !ok { cw.next <- &Result{Action: "delete", Service: old} } }