Skip to content

Commit

Permalink
Try to reduce CPU utilization by not fetching all (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
MattBlack85 authored Jan 11, 2022
1 parent c7e1c8d commit bb41f1b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"

[dependencies]
minreq = { version = "2.4.2", features = ["https"] }
sysinfo = "0.22.3"
sysinfo = "0.22.5"
structopt = { version = "0.3", default-features = false }
dirs = "4.0"
chrono = "0.4.19"
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ fn main() -> Result<(), Error> {
let start_time: String = chrono::Local::now().to_rfc3339_opts(SecondsFormat::Secs, false);

loop {
system.refresh_all();
let kstars_proc = system.process_by_name("kstars");
system.refresh_processes();
let kstars_proc = system.process_by_exact_name("kstars");
if kstars_proc.is_empty() {
let _resp = notify_via_telegram(&api_token)?;
};
Expand Down

0 comments on commit bb41f1b

Please sign in to comment.