register fix

This commit is contained in:
Piotr Biernat 2022-12-02 14:24:27 +01:00
parent d99436d2d6
commit e0a18538d4

View File

@ -115,14 +115,12 @@ func (s *Service) healthCheck() (bool, error) {
if alive { if alive {
if err := s.ConsulAgent.PassTTL("service:"+s.GetID(), "OK"); err != nil { if err := s.ConsulAgent.PassTTL("service:"+s.GetID(), "OK"); err != nil {
return false, err return false, err
// log.Println("health-check pass err:" + err.Error())
} }
return true, nil return true, nil
} }
if err := s.ConsulAgent.FailTTL("service:"+s.GetID(), ErrServiceUnavailable.Error()); err != nil { if err := s.ConsulAgent.FailTTL("service:"+s.GetID(), ErrServiceUnavailable.Error()); err != nil {
return false, err return false, err
// log.Println("health-check fail err:" + err.Error())
} }
return false, ErrServiceUnavailable return false, ErrServiceUnavailable
} }