From 32a89d9747a424db735926bbbe0daa96c13cea94 Mon Sep 17 00:00:00 2001 From: Piotr Biernat Date: Fri, 2 Dec 2022 18:48:12 +0100 Subject: [PATCH] consul ttl fix --- consul/discovery.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/consul/discovery.go b/consul/discovery.go index 80815cd..53115af 100644 --- a/consul/discovery.go +++ b/consul/discovery.go @@ -81,9 +81,8 @@ func (s *Service) Register() error { }() go func() { // TTL - // interval := s.TTL - time.Second*3 - // ticker := time.NewTicker(interval /*s.TTL*/) - ticker := time.NewTicker(s.TTL) + interval := s.TTL - time.Second*3 + ticker := time.NewTicker(interval) for range ticker.C { fmt.Println("HC call: ", time.Now().String()) _, err := s.healthCheck()