From d99436d2d611880e56cf4c4814d84bec67fe6b59 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Fri, 2 Dec 2022 14:21:33 +0100 Subject: [PATCH] register fix --- consul/discovery.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/consul/discovery.go b/consul/discovery.go index 9407677..b45bfb4 100644 --- a/consul/discovery.go +++ b/consul/discovery.go @@ -2,7 +2,6 @@ package consul import ( "fmt" - "log" "net/http" "strconv" "time" @@ -115,13 +114,15 @@ func (s *Service) healthCheck() (bool, error) { if alive { if err := s.ConsulAgent.PassTTL("service:"+s.GetID(), "OK"); err != nil { - log.Println("health-check pass err:" + err.Error()) + return false, err + // log.Println("health-check pass err:" + err.Error()) } return true, nil } if err := s.ConsulAgent.FailTTL("service:"+s.GetID(), ErrServiceUnavailable.Error()); err != nil { - log.Println("health-check fail err:" + err.Error()) + return false, err + // log.Println("health-check fail err:" + err.Error()) } return false, ErrServiceUnavailable }