consul ttl fix

This commit is contained in:
Piotr Biernat 2022-12-02 18:48:12 +01:00
parent 3b6acdc195
commit 32a89d9747

View File

@ -81,9 +81,8 @@ func (s *Service) Register() error {
}() }()
go func() { // TTL go func() { // TTL
// interval := s.TTL - time.Second*3 interval := s.TTL - time.Second*3
// ticker := time.NewTicker(interval /*s.TTL*/) ticker := time.NewTicker(interval)
ticker := time.NewTicker(s.TTL)
for range ticker.C { for range ticker.C {
fmt.Println("HC call: ", time.Now().String()) fmt.Println("HC call: ", time.Now().String())
_, err := s.healthCheck() _, err := s.healthCheck()