consul ttl fix
This commit is contained in:
parent
128e3db0b6
commit
3b6acdc195
@ -81,9 +81,15 @@ func (s *Service) Register() error {
|
|||||||
}()
|
}()
|
||||||
|
|
||||||
go func() { // TTL
|
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 {
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user