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 {
|
func (s *Service) Register() error {
|
||||||
def := &consul.AgentServiceRegistration{
|
def := &consul.AgentServiceRegistration{
|
||||||
ID: s.AppID,
|
ID: s.Name + "_" + s.AppID,
|
||||||
Name: s.Name,
|
Name: s.Name,
|
||||||
Address: s.IP,
|
Address: s.IP,
|
||||||
Port: s.Port,
|
Port: s.Port,
|
||||||
@ -74,7 +74,7 @@ func (s *Service) UpdateTTL(service *consul.AgentServiceRegistration) {
|
|||||||
for range ticker.C {
|
for range ticker.C {
|
||||||
ok, err := s.check()
|
ok, err := s.check()
|
||||||
if !ok {
|
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)
|
log.Println(err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user