mirror of
https://github.com/RGBCube/superfreq
synced 2025-07-27 17:07:44 +00:00
daemon: enforce user-configured min and max polling interval limits
This commit is contained in:
parent
264cd6a4e9
commit
7047f64984
1 changed files with 6 additions and 0 deletions
|
@ -411,6 +411,12 @@ pub fn run_daemon(mut config: AppConfig, verbose: bool) -> Result<(), Box<dyn st
|
||||||
- ((current_poll_interval - optimal_interval) / 2).max(1);
|
- ((current_poll_interval - optimal_interval) / 2).max(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure that we respect the (user) configured min and max limits
|
||||||
|
current_poll_interval = current_poll_interval.clamp(
|
||||||
|
config.daemon.min_poll_interval_sec,
|
||||||
|
config.daemon.max_poll_interval_sec,
|
||||||
|
);
|
||||||
|
|
||||||
debug!("Adaptive polling: set interval to {current_poll_interval}s");
|
debug!("Adaptive polling: set interval to {current_poll_interval}s");
|
||||||
} else {
|
} else {
|
||||||
// If adaptive polling is disabled, still apply battery-saving adjustment
|
// If adaptive polling is disabled, still apply battery-saving adjustment
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue