mirror of
https://github.com/RGBCube/superfreq
synced 2025-07-27 17:07:44 +00:00
daemon: prioritize load checks over idle state in system state determination
This commit is contained in:
parent
f0932c64d9
commit
c046c27376
1 changed files with 8 additions and 6 deletions
|
@ -618,16 +618,18 @@ fn determine_system_state(report: &SystemReport, history: &SystemHistory) -> Sys
|
|||
}
|
||||
}
|
||||
|
||||
// Check idle state
|
||||
if history.is_system_idle() {
|
||||
return SystemState::Idle;
|
||||
}
|
||||
|
||||
// Check load
|
||||
// Check load first, as high load should take precedence over idle state
|
||||
let avg_load = report.system_load.load_avg_1min;
|
||||
if avg_load > 3.0 {
|
||||
return SystemState::HighLoad;
|
||||
}
|
||||
|
||||
// Check idle state only if we don't have high load
|
||||
if history.is_system_idle() {
|
||||
return SystemState::Idle;
|
||||
}
|
||||
|
||||
// Check for low load
|
||||
if avg_load < 0.5 {
|
||||
return SystemState::LowLoad;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue