web service need modify registry service nodes while register interval
This commit is contained in:
Hobo86 2019-11-02 16:39:56 +08:00
parent bd1918900e
commit e8d2f207d8

View File

@ -118,6 +118,11 @@ func (s *service) register() error {
if s.opts.Registry != nil {
r = s.opts.Registry
}
// service node need modify, node address maybe changed
srv := s.genSrv()
srv.Endpoints = s.srv.Endpoints
s.srv = srv
return r.Register(s.srv, registry.RegisterTTL(s.opts.RegisterTTL))
}