Don't finish main cargo watch thread when subprocess finishes.

This commit is contained in:
Emil Lauridsen 2019-12-27 12:43:14 +01:00
parent ed84c85aef
commit c732f215cb
2 changed files with 5 additions and 3 deletions

View File

@ -193,8 +193,7 @@ impl CheckWatcherState {
recv(self.watcher.message_recv) -> msg => match msg {
Ok(msg) => self.handle_message(msg, task_send),
Err(RecvError) => {
// Task channel has closed, so shut down
break;
// Watcher finished, do nothing.
},
}
};

View File

@ -184,7 +184,10 @@ pub fn main_loop(
Err(RecvError) => Err("vfs died")?,
},
recv(libdata_receiver) -> data => Event::Lib(data.unwrap()),
recv(world_state.check_watcher.task_recv) -> task => Event::CheckWatcher(task.unwrap())
recv(world_state.check_watcher.task_recv) -> task => match task {
Ok(task) => Event::CheckWatcher(task),
Err(RecvError) => Err("check watcher died")?,
}
};
if let Event::Msg(Message::Request(req)) = &event {
if connection.handle_shutdown(&req)? {