fix bug in blocking thread

This commit is contained in:
Paul 2022-12-29 14:02:01 +01:00
parent 9644182c4e
commit a2a79d8459

View File

@ -118,8 +118,10 @@ async fn watchfiles(ctx: &Arc<Mutex<Context>>) -> Receiver<FileEvent> {
loop {
let events: Vec<InotifyEvent>;
{
let ctx = ctx.lock().await;
events = ctx.instance.read_events().unwrap();
let c = ctx.lock().await;
let instance = c.instance.clone();
drop(c);
events = instance.read_events().unwrap();
}
for inevent in events {