Consul update ttl fix
This commit is contained in:
parent
67f43f98cb
commit
71379b1729
@ -1,3 +1,5 @@
|
||||
# go-api-pkg
|
||||
|
||||
Base API go packages.
|
||||
|
||||
Remeber to tag as "dev" after changes are made in develop branch.
|
||||
|
@ -77,11 +77,11 @@ func (s *Service) UpdateTTL(service *consul.AgentServiceRegistration) {
|
||||
for range ticker.C {
|
||||
ok, err := s.check()
|
||||
if !ok {
|
||||
if err := s.ConsulAgent.FailTTL("service:"+s.Name, err.Error()); err != nil {
|
||||
if err := s.ConsulAgent.FailTTL("service:"+s.AppID, err.Error()); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
} else {
|
||||
if err := s.ConsulAgent.PassTTL("service:"+s.Name, "OK"); err != nil {
|
||||
if err := s.ConsulAgent.PassTTL("service:"+s.AppID, "OK"); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user