fix in consul discovery
This commit is contained in:
parent
767eb5688c
commit
82d68e91b8
@ -102,13 +102,14 @@ func (s *Service) Register() error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (s *Service) Unregister() error {
|
func (s *Service) Unregister() error {
|
||||||
|
s.ttlTicker.Stop()
|
||||||
|
s.hcTicker.Stop()
|
||||||
|
|
||||||
s.client.Catalog().Deregister(&consul.CatalogDeregistration{
|
s.client.Catalog().Deregister(&consul.CatalogDeregistration{
|
||||||
Address: s.Address,
|
Address: s.Address,
|
||||||
ServiceID: s.GetID(),
|
ServiceID: s.GetID(),
|
||||||
}, nil)
|
}, nil)
|
||||||
|
|
||||||
s.ttlTicker.Stop()
|
|
||||||
|
|
||||||
return s.agent.ServiceDeregister(s.GetID())
|
return s.agent.ServiceDeregister(s.GetID())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user