Skip to content

Commit

Permalink
> fix send event error if watcher stopped
Browse files Browse the repository at this point in the history
  • Loading branch information
kebe7jun committed Oct 21, 2022
1 parent ee5995c commit 37715d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion process_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ func (pw *processWatcher) Events() <-chan WatchEvent {

func (pw *processWatcher) sendEvents(e WatchEvent) {
select {
case pw.events <- e:
case <-pw.stop:
return
default:
}
pw.events <- e
}

func (pw *processWatcher) Start() error {
Expand Down

0 comments on commit 37715d1

Please sign in to comment.