mirror of
https://github.com/open-goal/launcher.git
synced 2024-10-19 14:47:36 -04:00
backend: ensure logs are pushed to the frontend when the process terminates (#584)
Some checks failed
📝 Linter / Frontend (push) Has been cancelled
📝 Linter / Backend Formatting (push) Has been cancelled
📝 Linter / Backend Linter (push) Has been cancelled
🧪 Tests / Frontend (push) Has been cancelled
🔨 Build / App (macos-12) (push) Has been cancelled
🔨 Build / App (ubuntu-20.04) (push) Has been cancelled
🔨 Build / App (windows-latest) (push) Has been cancelled
Some checks failed
📝 Linter / Frontend (push) Has been cancelled
📝 Linter / Backend Formatting (push) Has been cancelled
📝 Linter / Backend Linter (push) Has been cancelled
🧪 Tests / Frontend (push) Has been cancelled
🔨 Build / App (macos-12) (push) Has been cancelled
🔨 Build / App (ubuntu-20.04) (push) Has been cancelled
🔨 Build / App (windows-latest) (push) Has been cancelled
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)
This commit is contained in:
parent
6ea179ae98
commit
88f93aab4c
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue