Skip to content

Commit

Permalink
backend: ensure logs are pushed to the frontend when the process term…
Browse files Browse the repository at this point in the history
…inates (#584)

This was leading to awkward situations where there are no logs in the
frontend if the binaries immediately fail.

Fixed now:

![image](https://github.com/user-attachments/assets/441e6b7d-2f59-487c-b47d-a49d46eb8c12)
  • Loading branch information
xTVaser authored Oct 5, 2024
1 parent 6ea179a commit 88f93aa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src-tauri/src/util/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ pub async fn watch_process(
},
// Wait for the child process to finish
status = child.wait() => {
let mut buf = buffer_clone.lock().await;
let _ = app_handle.emit_all("log_update", LogPayload { logs: buf.clone() });
buf.clear();
process_status = Some(status?);
break;
}
Expand Down

0 comments on commit 88f93aa

Please sign in to comment.