config: service, but ignore error channel.

This commit is contained in:
Daniel Theophanes
2014-08-17 17:05:42 -07:00
parent a62b26890e
commit fa57b391c2
+2 -5
View File
@@ -66,7 +66,6 @@ type EncodeConfig func(w io.Writer, v interface{}) error
type WatchConfig struct {
// Notified here if the file changes.
C chan *WatchConfig
Err chan error
filepath string
watch *fsnotify.Watcher
@@ -108,7 +107,6 @@ func NewWatchConfig(filepath string, decode DecodeConfig, defaultConfig interfac
wc := &WatchConfig{
C: make(chan *WatchConfig),
Err: make(chan error),
filepath: filepath,
watch: watch,
@@ -130,10 +128,9 @@ func (wc *WatchConfig) run() {
select {
case <-wc.close:
close(wc.C)
close(wc.Err)
return
case err := <-wc.watch.Errors:
wc.Err <- err
case <-wc.watch.Errors:
// Nothing right now.
case <-wc.watch.Events:
trigger = true
case <-ticker.C: