close stream

This commit is contained in:
Asim Aslam 2020-01-19 22:55:57 +00:00
parent 9df19e826e
commit 04cf86070c

View File

@ -42,8 +42,6 @@ func newWatcher(rsp pb.Router_WatchService, opts router.WatchOptions) (*watcher,
// watchRouter watches router and send events to all registered watchers
func (w *watcher) watch(stream pb.Router_WatchService) error {
defer stream.Close()
var watchErr error
for {
@ -110,6 +108,7 @@ func (w *watcher) Stop() {
case <-w.done:
return
default:
w.stream.Close()
close(w.done)
}
}