summaryrefslogtreecommitdiffstats
path: root/src/utils/process.rs
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2021-12-11 15:31:34 -0500
committerGitHub <noreply@github.com>2021-12-11 15:31:34 -0500
commit69c7aaa28fdda955cf430134170e3a533970cc0f (patch)
tree55d68bb4f93e2c63d77f30d0ede49d8d643ab853 /src/utils/process.rs
parent5c1612ec0ad328249a611933cf7d13b05a99680a (diff)
Do not query CPU data when querying process data (#845)
* Do not query CPU data when querying process data Fixes #839 Ref https://github.com/GuillaumeGomez/sysinfo/issues/632 * Update branch of sysinfo * Update upstream sysinfo commit Ref https://github.com/GuillaumeGomez/sysinfo/pull/636 * Point sysinfo at an explicit commit rather than a symbolic branch name commit d647acfbf216848a8237e1f9251b2c48860a547f Merge: 989ac6c 67a586c Author: Guillaume Gomez <guillaume1.gomez@gmail.com> Date: 2 hours ago Merge pull request #636 from GuillaumeGomez/update-if-needed Only update processors if needed
Diffstat (limited to 'src/utils/process.rs')
-rw-r--r--src/utils/process.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/utils/process.rs b/src/utils/process.rs
index 5602dd3f..68b57a6a 100644
--- a/src/utils/process.rs
+++ b/src/utils/process.rs
@@ -1,7 +1,7 @@
use std::borrow::Cow;
use std::collections::{HashMap, HashSet};
use std::path::Path;
-use sysinfo::{Pid, Process, ProcessExt, SystemExt};
+use sysinfo::{Pid, Process, ProcessExt, ProcessRefreshKind, SystemExt};
use lazy_static::lazy_static;
@@ -347,7 +347,8 @@ impl ProcessInterface for ProcInfo {
std::process::id() as Pid
}
fn refresh_process(&mut self, pid: Pid) -> bool {
- self.info.refresh_process(pid)
+ self.info
+ .refresh_process_specifics(pid, ProcessRefreshKind::new())
}
fn process(&self, pid: Pid) -> Option<&Self::Out> {
self.info.process(pid)
@@ -356,7 +357,8 @@ impl ProcessInterface for ProcInfo {
self.info.processes()
}
fn refresh_processes(&mut self) {
- self.info.refresh_processes()
+ self.info
+ .refresh_processes_specifics(ProcessRefreshKind::new())
}
}