1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-24 16:19:12 -05:00

fix: call unwatch when dropping FsEventsResource (#4266)

This commit is contained in:
Ryan Dahl 2020-03-05 20:01:08 -05:00 committed by GitHub
parent 2e59007214
commit afea9b2edd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,7 +76,9 @@ pub fn op_fs_events_open(
Watcher::new_immediate(move |res: Result<NotifyEvent, NotifyError>| { Watcher::new_immediate(move |res: Result<NotifyEvent, NotifyError>| {
let res2 = res.map(FsEvent::from).map_err(ErrBox::from); let res2 = res.map(FsEvent::from).map_err(ErrBox::from);
let mut sender = sender.lock().unwrap(); 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)?; .map_err(ErrBox::from)?;
let recursive_mode = if args.recursive { let recursive_mode = if args.recursive {