-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sidecar process is still alive when the main process exits #1896
Comments
Process cleanup must be done manually :( I think we can do it on our end for sidecar processes though. |
@lucasfernog Do you know how specify to tauri to keep the sidecar process alive since now it is killed by default? |
You could listen to the ExitRequested RunEvent like this: tauri/examples/api/src-tauri/src/main.rs Lines 242 to 244 in b02fc90
std::process::exit(0) to exit the app instead of Tauri's exit. This will skip the sidecar cleanup but also the system tray cleanup :/
p.s. not sure if that's actually enough to keep the process running, but this removes Tauri's manual clean-up |
@FabianLars Nice, I never noticed this part of the API
|
Forgot to mention that stuff, you can also convert sidecars to std commands (in case you wanna use sidecars instead of resources). Something like this iirc let tauri_cmd = tauri::process::Command::new_sidecar("sidecar").unwrap();
let std_cmd = std::process::Command::from(tauri_cmd); |
Hi FabianLars - For some reason I'm attempting to recreate what you suggested, and even attempted to follow the tauri::api::process::Command -> from(cmd: Command) -> StdCommand, but for some reason I get this error:
Edit: I'm a Swift first developer, and I seriously need to work more on FnMut and such... here was my workaround if it helps anyone: RunEvent::ExitRequested { api, .. } => {
|
The last line was wrong, it'd be |
First of all, I think this project is really great!❤
But I have encountered a little problem in using it.
I have embedded an aria2 downloader in the program using Sidecar. Everything was working fine until I closed the program and found that the aria2 process was still alive.
How should I deal with this problem?
I solved it in the following way for now. But I think it is the wrong way.
The text was updated successfully, but these errors were encountered: