diff --git a/consul/discovery.go b/consul/discovery.go index 78274fa..0520835 100644 --- a/consul/discovery.go +++ b/consul/discovery.go @@ -48,7 +48,7 @@ func newClientConfig(serverAddr string) *consul.Config { func (s *Service) Register() error { def := &consul.AgentServiceRegistration{ - ID: s.AppID, + ID: s.Name + "_" + s.AppID, Name: s.Name, Address: s.IP, Port: s.Port, @@ -74,7 +74,7 @@ func (s *Service) UpdateTTL(service *consul.AgentServiceRegistration) { for range ticker.C { ok, err := s.check() if !ok { - if err := s.ConsulAgent.FailTTL("service:"+s.AppID, err.Error()); err != nil { + if err := s.ConsulAgent.FailTTL("service:"+s.Name+"_"+s.AppID, err.Error()); err != nil { log.Println(err) } } else {