Open amelhusic opened 4 years ago
This will not stop the goroutines from running once the Watcher is stopped. One way to do that is to add a check in the infinite loops to stop them when the Watcher is stopped:
for {
select {
case <-w.shutdownCh:
return
default:
}
// work
}
Additionally, I'd prefer exposing a Stop()
method rather than the chan directly.
I applied your recommendations.
Please recheck and give a thumbs up for mergeing.
this fix is related to: https://github.com/haproxytech/haproxy-consul-connect/issues/10