diff --git a/consul/discovery.go b/consul/discovery.go index b446c14..54c460c 100644 --- a/consul/discovery.go +++ b/consul/discovery.go @@ -102,13 +102,14 @@ func (s *Service) Register() error { return nil } func (s *Service) Unregister() error { + s.ttlTicker.Stop() + s.hcTicker.Stop() + s.client.Catalog().Deregister(&consul.CatalogDeregistration{ Address: s.Address, ServiceID: s.GetID(), }, nil) - s.ttlTicker.Stop() - return s.agent.ServiceDeregister(s.GetID()) }