fix panic of std::Instant overflow (#1243)

This commit is contained in:
Sijie.Sun
2025-08-15 22:54:58 +08:00
committed by GitHub
parent 4d240efde9
commit fa3e208668

View File

@@ -501,7 +501,9 @@ impl StatsManager {
loop {
interval.tick().await;
let cutoff_time = Instant::now() - Duration::from_secs(180); // 3 minutes
let Some(cutoff_time) = Instant::now().checked_sub(Duration::from_secs(180)) else {
continue;
};
let Some(counters) = counters_clone.upgrade() else {
break;