feat: kill sidecars when update app

This commit is contained in:
GyDi
2022-02-17 02:10:25 +08:00
parent 3dfe7c27cd
commit 5b83fb496c
4 changed files with 14 additions and 1 deletions

View File

@@ -5,7 +5,7 @@ use crate::{
};
use serde_yaml::Mapping;
use std::process::Command;
use tauri::State;
use tauri::{api, State};
/// get all profiles from `profiles.yaml`
/// do not acquire the lock of ProfileLock
@@ -273,6 +273,12 @@ pub async fn patch_verge_config(
verge.patch_config(payload)
}
/// kill all sidecars when update app
#[tauri::command]
pub fn kill_sidecars() {
api::process::kill_children();
}
/// open app config dir
#[tauri::command]
pub fn open_app_dir() -> Result<(), String> {

View File

@@ -74,6 +74,7 @@ fn main() -> std::io::Result<()> {
cmds::restart_sidecar,
cmds::get_sys_proxy,
cmds::get_cur_proxy,
cmds::kill_sidecars,
cmds::open_app_dir,
cmds::open_logs_dir,
// clash