From 82d68e91b85c8ab7816896dd59df18fb63fe49b3 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Fri, 19 Jul 2024 16:41:37 +0200 Subject: [PATCH] fix in consul discovery --- consul/discovery.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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()) }