From b699008fa35ec34eee36afd752e1f15104f525d7 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Wed, 17 Jul 2024 18:57:50 +0200 Subject: [PATCH] Fix for better unregistering? --- consul/discovery.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/consul/discovery.go b/consul/discovery.go index 94d2c67..67ce73d 100644 --- a/consul/discovery.go +++ b/consul/discovery.go @@ -95,6 +95,11 @@ func (s *Service) Register() error { return nil } func (s *Service) Unregister() error { + s.client.Catalog().Deregister(&consul.CatalogDeregistration{ + Address: s.Address, + ServiceID: s.GetID(), + }, nil) + return s.agent.ServiceDeregister(s.GetID()) }