Consul debug

This commit is contained in:
Piotr Biernat 2023-06-28 23:34:45 +02:00
parent fc88125fe4
commit a37f6209ff

View File

@ -87,15 +87,15 @@ func (s *Service) Register() error {
}
}(s)
// go func(s *Service) { // TTL
// interval := s.ttl - time.Second*2 // 2 seconds overhead
// ticker := time.NewTicker(interval)
// for range ticker.C {
// if _, err := s.healthCheck(); err != nil {
// fmt.Printf("TTL Error #: %v\n", err)
// }
// }
// }(s)
go func(s *Service) { // TTL
interval := s.ttl - time.Second*2 // 2 seconds overhead
ticker := time.NewTicker(interval)
for range ticker.C {
if _, err := s.healthCheck(); err != nil {
fmt.Printf("TTL Error #: %v\n", err)
}
}
}(s)
return nil
}