Skip to content

Commit

Permalink
Cargo format
Browse files Browse the repository at this point in the history
  • Loading branch information
Camerooooon committed Jun 9, 2022
1 parent abd9fb6 commit 8bfa549
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl SafeFillConfig for SafeConfig {
if self.overheat_threshold.is_some() {
base.overheat_threshold = self.overheat_threshold.unwrap();
}

if self.high_cpu_threshold.is_some() {
base.high_cpu_threshold = self.high_cpu_threshold.unwrap();
}
Expand Down
4 changes: 3 additions & 1 deletion src/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ impl Checker for Daemon {
let mut state = State::Normal;

if self.config.active_rules.contains(&State::CpuUsageHigh) {
if self.usage > self.config.high_cpu_threshold.into() && self.last_below_cpu_usage_percent.is_none() {
if self.usage > self.config.high_cpu_threshold.into()
&& self.last_below_cpu_usage_percent.is_none()
{
self.last_below_cpu_usage_percent = Some(SystemTime::now());
}

Expand Down

0 comments on commit 8bfa549

Please sign in to comment.