From fc88125fe49f5f05c107d85f5d5320bf951ccfe5 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Wed, 28 Jun 2023 23:22:15 +0200 Subject: [PATCH] Consul debug --- consul/discovery.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/consul/discovery.go b/consul/discovery.go index db5029c..5b33196 100644 --- a/consul/discovery.go +++ b/consul/discovery.go @@ -119,7 +119,7 @@ func (s *Service) healthCheck() (bool, error) { if err != nil { return false } - req.Header.Set("User-Agent", "Health Check") + req.Header.Set("User-Agent", "service/internal") resp, err := client.Do(req) if err != nil { @@ -132,6 +132,7 @@ func (s *Service) healthCheck() (bool, error) { if alive { if err := s.agent.PassTTL("service:"+s.GetID(), "OK"); err != nil { + fmt.Printf("Failed to pass TTL: %v", err) return false, err } return true, nil