From a9eb0d0732f917144f22a90d4a583ca57ff8c0c0 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Sat, 20 Jul 2024 18:19:56 +0200 Subject: [PATCH] debug fix --- consul/discovery.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/consul/discovery.go b/consul/discovery.go index ed89c21..71e2e2c 100644 --- a/consul/discovery.go +++ b/consul/discovery.go @@ -162,12 +162,14 @@ func (s *Service) healthCheck() (bool, error) { // fmt.Printf("HealthCheck URL: %s%s?name=%s", s.GetFullAddr(), "health", s.Name) req, err := http.NewRequest(http.MethodGet, healthUrl, nil) if err != nil { + fmt.Println(err) return false } req.Header.Set("User-Agent", "service/internal") resp, err := client.Do(req) if err != nil { + fmt.Println(err) return false } defer resp.Body.Close() @@ -175,6 +177,8 @@ func (s *Service) healthCheck() (bool, error) { var body []byte resp.Body.Read(body) + fmt.Println(resp.StatusCode) + return resp.StatusCode == http.StatusOK }()