Fix TCP address and port on service check registration

This commit is contained in:
Shulhan 2018-03-19 20:34:12 +07:00
parent 1599d717af
commit f4cdfaf27f

View File

@ -172,7 +172,7 @@ func (c *consulRegistry) Register(s *Service, opts ...RegisterOption) error {
deregTTL := getDeregisterTTL(options.Interval) deregTTL := getDeregisterTTL(options.Interval)
check = &consul.AgentServiceCheck{ check = &consul.AgentServiceCheck{
TCP: c.Address, TCP: fmt.Sprintf("%s:%d", node.Address, node.Port),
Interval: fmt.Sprintf("%v", options.Interval), Interval: fmt.Sprintf("%v", options.Interval),
DeregisterCriticalServiceAfter: fmt.Sprintf("%v", deregTTL), DeregisterCriticalServiceAfter: fmt.Sprintf("%v", deregTTL),
} }