()
| 316 | |
| 317 | #[tauri::command] |
| 318 | async fn stop_components() -> Result<(), String> { |
| 319 | use std::time::Duration; |
| 320 | |
| 321 | // 停止 rclone |
| 322 | if let Some(pid) = sidecar::get_sidecar_pid("rclone") { |
| 323 | println!("Stopping rclone (PID: {})", pid); |
| 324 | sidecar::kill_sidecar("rclone"); |
| 325 | // 等待进程完全退出 |
| 326 | tokio::time::sleep(Duration::from_millis(300)).await; |
| 327 | } |
| 328 | |
| 329 | // 停止 openlist |
| 330 | if let Some(pid) = sidecar::get_sidecar_pid("openlist") { |
| 331 | println!("Stopping openlist (PID: {})", pid); |
| 332 | sidecar::kill_sidecar("openlist"); |
| 333 | // 等待进程完全退出 |
| 334 | tokio::time::sleep(Duration::from_millis(300)).await; |
| 335 | } |
| 336 | |
| 337 | println!("All components stopped"); |
| 338 | Ok(()) |
| 339 | } |
| 340 | |
| 341 | #[tauri::command] |
| 342 | fn get_winfsp_install_state() -> Result<bool, usize> { |
nothing calls this directly
no test coverage detected