mirror of
https://github.com/Cyrix126/gupaxx.git
synced 2024-12-22 22:59:27 +00:00
fix: spare_time being larger than max algo time
This commit is contained in:
parent
a83600a6e0
commit
b34839a793
1 changed files with 4 additions and 1 deletions
|
@ -74,7 +74,7 @@ pub(crate) fn calcul_donated_time(
|
|||
let mode = lock!(gui_api_xvb).stats_priv.runtime_mode.clone();
|
||||
|
||||
let default_spared_time = time_that_could_be_spared(lhr, min_hr);
|
||||
let spared_time = match mode {
|
||||
let mut spared_time = match mode {
|
||||
RuntimeMode::Auto => {
|
||||
info!("RuntimeMode::Auto - calculating spared_time");
|
||||
// calculate how much time needed to be spared to be in most round type minimum HR + buffer
|
||||
|
@ -109,6 +109,9 @@ pub(crate) fn calcul_donated_time(
|
|||
};
|
||||
|
||||
info!("Final spared_time is {spared_time}");
|
||||
if spared_time > XVB_TIME_ALGO {
|
||||
spared_time = XVB_TIME_ALGO;
|
||||
}
|
||||
|
||||
spared_time
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue