initChan is never evaluated because watchRegistry is a blocking call

This commit is contained in:
Asim Aslam 2020-08-07 23:44:43 +01:00 committed by Vasiliy Tolstov
parent 92870d5d32
commit 1519dcb3e1

View File

@ -272,6 +272,8 @@ func (r *rtr) watchRegistry(w registry.Watcher) error {
select {
case <-exit:
return
case <-r.initChan:
return
case <-r.exit:
return
}
@ -578,14 +580,6 @@ func (r *rtr) start() error {
w.Stop()
}
return
case <-r.initChan:
// the registry could have changed during initialization
// so if there was a watcher setup, stop it and create a
// new one
if w != nil {
w.Stop()
w = nil
}
default:
if w == nil {
w, err = r.options.Registry.Watch(registry.WatchDomain(registry.WildcardDomain))