Don't generate file watch events if disabled

This previously ignored the events, but they were still generated!
This commit is contained in:
James Shubin
2016-01-20 02:05:26 -05:00
parent 491e9fd9bc
commit 0ca9351665

View File

@@ -99,7 +99,10 @@ func run(c *cli.Context) {
startchan := make(chan struct{}) // start signal
go func() { startchan <- struct{}{} }()
file := c.String("file")
configchan := ConfigWatch(file)
configchan := make(chan bool)
if !c.Bool("no-watch") {
configchan = ConfigWatch(file)
}
log.Printf("Etcd: Starting...")
etcdchan := etcdO.EtcdWatch()
first := true // first loop or not