Skip to content

Commit 37715d1

Browse files
committed
> fix send event error if watcher stopped
1 parent ee5995c commit 37715d1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

process_watcher.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,11 @@ func (pw *processWatcher) Events() <-chan WatchEvent {
7373

7474
func (pw *processWatcher) sendEvents(e WatchEvent) {
7575
select {
76-
case pw.events <- e:
7776
case <-pw.stop:
77+
return
78+
default:
7879
}
80+
pw.events <- e
7981
}
8082

8183
func (pw *processWatcher) Start() error {

0 commit comments

Comments
 (0)