fix: close side windows should not kill background processes (#5076)
This commit is contained in:
parent
7df7d8ffa0
commit
2dda66390d
@ -63,7 +63,7 @@ pub async fn run_mcp_commands<R: Runtime>(
|
|||||||
if command.clone() == "uvx" {
|
if command.clone() == "uvx" {
|
||||||
let bun_x_path = format!("{}/uv", bin_path.display());
|
let bun_x_path = format!("{}/uv", bin_path.display());
|
||||||
cmd = Command::new(bun_x_path);
|
cmd = Command::new(bun_x_path);
|
||||||
cmd.arg("tool run");
|
cmd.arg("tool");
|
||||||
cmd.arg("run");
|
cmd.arg("run");
|
||||||
}
|
}
|
||||||
println!("Command: {cmd:#?}");
|
println!("Command: {cmd:#?}");
|
||||||
|
|||||||
@ -111,11 +111,13 @@ pub fn run() {
|
|||||||
})
|
})
|
||||||
.on_window_event(|window, event| match event {
|
.on_window_event(|window, event| match event {
|
||||||
tauri::WindowEvent::CloseRequested { .. } => {
|
tauri::WindowEvent::CloseRequested { .. } => {
|
||||||
let client = Client::new();
|
if window.label() == "main" {
|
||||||
let url = "http://127.0.0.1:39291/processManager/destroy";
|
let client = Client::new();
|
||||||
let _ = client.delete(url).send();
|
let url = "http://127.0.0.1:39291/processManager/destroy";
|
||||||
|
let _ = client.delete(url).send();
|
||||||
|
|
||||||
window.emit("kill-sidecar", ()).unwrap();
|
window.emit("kill-sidecar", ()).unwrap();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user