Skip to content

Commit

Permalink
fix: call unwatch when dropping FsEventsResource (denoland#4266)
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Mar 6, 2020
1 parent 2e59007 commit afea9b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cli/ops/fs_events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ pub fn op_fs_events_open(
Watcher::new_immediate(move |res: Result<NotifyEvent, NotifyError>| {
let res2 = res.map(FsEvent::from).map_err(ErrBox::from);
let mut sender = sender.lock().unwrap();
futures::executor::block_on(sender.send(res2)).expect("fs events error");
// Ignore result, if send failed it means that watcher was already closed,
// but not all messages have been flushed.
let _ = futures::executor::block_on(sender.send(res2));
})
.map_err(ErrBox::from)?;
let recursive_mode = if args.recursive {
Expand Down

0 comments on commit afea9b2

Please sign in to comment.