This commit is contained in:
Piotr Biernat 2022-12-01 17:15:21 +01:00
parent 0897551a43
commit 3e2d5b703d

View File

@ -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 {