initChan is never evaluated because watchRegistry is a blocking call
This commit is contained in:
parent
9b14eb8aec
commit
712fe39a62
@ -272,6 +272,8 @@ func (r *rtr) watchRegistry(w registry.Watcher) error {
|
|||||||
select {
|
select {
|
||||||
case <-exit:
|
case <-exit:
|
||||||
return
|
return
|
||||||
|
case <-r.initChan:
|
||||||
|
return
|
||||||
case <-r.exit:
|
case <-r.exit:
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -578,14 +580,6 @@ func (r *rtr) start() error {
|
|||||||
w.Stop()
|
w.Stop()
|
||||||
}
|
}
|
||||||
return
|
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:
|
default:
|
||||||
if w == nil {
|
if w == nil {
|
||||||
w, err = r.options.Registry.Watch(registry.WatchDomain(registry.WildcardDomain))
|
w, err = r.options.Registry.Watch(registry.WatchDomain(registry.WildcardDomain))
|
||||||
|
Loading…
Reference in New Issue
Block a user