Browse Source

Remove unused sysinfo monitor (#1007)

`sysinfo::System::refresh_processes` would fetch info from all processes
in the current OS, which is unnecessary when only one of them is of
interest.
tags/v0.3.12-rc0
Philipp Oppermann GitHub 1 year ago
parent
commit
e7f7a9fd0c
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      binaries/daemon/src/lib.rs

+ 3
- 2
binaries/daemon/src/lib.rs View File

@@ -1796,10 +1796,11 @@ impl ProcessId {

pub fn kill(&mut self) -> bool {
if let Some(pid) = self.0 {
let pid = Pid::from(pid as usize);
let mut system = sysinfo::System::new();
system.refresh_processes();
system.refresh_process(pid);

if let Some(process) = system.process(Pid::from(pid as usize)) {
if let Some(process) = system.process(pid) {
process.kill();
self.mark_as_stopped();
return true;


Loading…
Cancel
Save