Fix deadlock

This commit is contained in:
mo8it 2024-08-11 14:58:50 +02:00
parent 7341b88e6f
commit 97a6fc65f1

View File

@ -131,6 +131,7 @@ fn run(mut self, inbox: Receiver<Message>) {
let (entry_tx, entry_rx) = unbounded();
let (watch_tx, watch_rx) = unbounded();
let processed = AtomicUsize::new(0);
config.load.into_par_iter().enumerate().for_each(|(i, entry)| {
let do_watch = config.watch.contains(&i);
if do_watch {
@ -167,9 +168,13 @@ fn run(mut self, inbox: Receiver<Message>) {
})
.unwrap();
});
drop(watch_tx);
for path in watch_rx {
self.watch(&path);
}
drop(entry_tx);
for entry in entry_rx {
match entry {
loader::Entry::Files(files) => {
@ -180,6 +185,7 @@ fn run(mut self, inbox: Receiver<Message>) {
}
}
}
self.sender
.send(loader::Message::Progress {
n_total,