fix: handle crashing or fast exiting monado-service properly (#9)

This commit is contained in:
Gabriele Musco 2023-06-15 21:57:48 +02:00
commit a97560d0d1
No known key found for this signature in database
GPG key ID: 1068D795C80E51DE

View file

@ -141,15 +141,21 @@ impl SimpleComponent for App {
Msg::UpdateView => { Msg::UpdateView => {
match &mut self.monado_runner { match &mut self.monado_runner {
None => {} None => {}
Some(runner) => match runner.status() { Some(runner) => {
RunnerStatus::Running => { let n_rows = runner.consume_rows();
self.monado_log.extend(runner.consume_rows()); if !n_rows.is_empty() {
self.monado_log.extend(n_rows);
self.debug_view self.debug_view
.sender() .sender()
.emit(DebugViewMsg::LogUpdated(self.monado_log.clone())); .emit(DebugViewMsg::LogUpdated(self.monado_log.clone()));
} }
_ => {} match runner.status() {
}, RunnerStatus::Running => {},
RunnerStatus::Stopped => {
self.main_view.sender().emit(MainViewMsg::MonadoActiveChanged(false));
}
};
}
}; };
match &mut self.build_pipeline { match &mut self.build_pipeline {
None => {} None => {}