From 71379b172996ccc1f1ade6ffbabb67b595b33a48 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Thu, 1 Dec 2022 09:08:41 +0100 Subject: [PATCH] Consul update ttl fix --- README.md | 4 +++- consul/discovery.go | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e6aca40..63dcd57 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # go-api-pkg -Base API go packages. \ No newline at end of file +Base API go packages. + +Remeber to tag as "dev" after changes are made in develop branch. diff --git a/consul/discovery.go b/consul/discovery.go index d273622..b3cf31d 100644 --- a/consul/discovery.go +++ b/consul/discovery.go @@ -77,11 +77,11 @@ func (s *Service) UpdateTTL(service *consul.AgentServiceRegistration) { for range ticker.C { ok, err := s.check() if !ok { - if err := s.ConsulAgent.FailTTL("service:"+s.Name, err.Error()); err != nil { + if err := s.ConsulAgent.FailTTL("service:"+s.AppID, err.Error()); err != nil { log.Println(err) } } else { - if err := s.ConsulAgent.PassTTL("service:"+s.Name, "OK"); err != nil { + if err := s.ConsulAgent.PassTTL("service:"+s.AppID, "OK"); err != nil { log.Println(err) } }