fix
This commit is contained in:
parent
0897551a43
commit
3e2d5b703d
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user