summaryrefslogtreecommitdiffhomepage
path: root/server/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'server/server.go')
-rw-r--r--server/server.go16
1 files changed, 5 insertions, 11 deletions
diff --git a/server/server.go b/server/server.go
index fd0ebf1f..d83a4001 100644
--- a/server/server.go
+++ b/server/server.go
@@ -2554,17 +2554,11 @@ func (w *Watcher) Stop() {
}
}
- w.ch.Close()
- // make sure the loop function finishes
- func() {
- for {
- select {
- case <-w.realCh:
- default:
- return
- }
- }
- }()
+ cleanInfiniteChannel(w.ch)
+ // the loop function goroutine might be blocked for
+ // writing to realCh. make sure it finishes.
+ for range w.realCh {
+ }
}
}