refactor: better process management on linux

This commit is contained in:
zhom
2026-03-02 12:37:35 +04:00
parent 1ff17e6833
commit 576119e5a3
4 changed files with 184 additions and 21 deletions
+5 -3
View File
@@ -131,7 +131,9 @@ pub fn generate_proxy_id() -> String {
}
pub fn is_process_running(pid: u32) -> bool {
use sysinfo::{Pid, System};
let system = System::new();
system.process(Pid::from(pid as usize)).is_some()
use sysinfo::{ProcessRefreshKind, RefreshKind, System};
let system = System::new_with_specifics(
RefreshKind::nothing().with_processes(ProcessRefreshKind::everything()),
);
system.process(sysinfo::Pid::from_u32(pid)).is_some()
}