diff --git a/consul/discovery.go b/consul/discovery.go index b89ce2f..80815cd 100644 --- a/consul/discovery.go +++ b/consul/discovery.go @@ -81,9 +81,15 @@ func (s *Service) Register() error { }() go func() { // TTL - ticker := time.NewTicker(s.TTL - 3) + // interval := s.TTL - time.Second*3 + // ticker := time.NewTicker(interval /*s.TTL*/) + ticker := time.NewTicker(s.TTL) for range ticker.C { - s.healthCheck() + fmt.Println("HC call: ", time.Now().String()) + _, err := s.healthCheck() + if err != nil { + fmt.Printf("TTL Error: %v\n", err) + } } }()