mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
ISSUE #468 - After managing to reproduce it with Robert, this should fix the actual issue. The actual problem was checked subtraction in a timer loop carefully checking for the negative - which isn't allowed - and then doing it anyway. Oops.
This commit is contained in:
parent
667fec63e9
commit
12721dff85
@ -122,9 +122,9 @@ pub async fn update_total_throughput_buffer() {
|
||||
loop {
|
||||
let now = Instant::now();
|
||||
THROUGHPUT_BUFFER.tick().await;
|
||||
let wait_time = Duration::from_secs(1) - now.elapsed();
|
||||
if wait_time.as_micros() > 0 {
|
||||
rocket::tokio::time::sleep(Duration::from_secs(1)).await;
|
||||
let elapsed = now.elapsed();
|
||||
if elapsed < Duration::from_secs(1) {
|
||||
rocket::tokio::time::sleep(Duration::from_secs(1) - elapsed).await;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user