From 7a35d1f44a761fd212144203d6ee8a090fdc99e5 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Wed, 28 Jun 2023 22:54:58 +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 113a4ef..39fc8ed 100644 --- a/consul/discovery.go +++ b/consul/discovery.go @@ -92,7 +92,7 @@ func (s *Service) Register() error { ticker := time.NewTicker(interval) for range ticker.C { if _, err := s.healthCheck(); err != nil { - fmt.Printf("TTL Error: %v\n", err) + fmt.Printf("TTL Error #: %v\n", err) } } }(s) @@ -115,6 +115,7 @@ func (s *Service) healthCheck() (bool, error) { alive := func() bool { client := &http.Client{} healthUrl := s.GetFullAddr() + "health" + fmt.Printf("Sending request to the %s", healthUrl) req, err := http.NewRequest(http.MethodGet, healthUrl, nil) if err != nil { fmt.Printf("Failed to create new Consul request: %v\n", err)