update ratelimiter (#897)

* update ratelimiter

* Switch to old scheduler
This commit is contained in:
Geometrically
2024-03-27 15:56:29 -07:00
committed by GitHub
parent a0aa350a08
commit 0a0837ea02
12 changed files with 287 additions and 602 deletions

View File

@@ -19,9 +19,9 @@ impl Scheduler {
}
pub fn run<F, R>(&mut self, interval: std::time::Duration, mut task: F)
where
F: FnMut() -> R + Send + 'static,
R: std::future::Future<Output = ()> + Send + 'static,
where
F: FnMut() -> R + Send + 'static,
R: std::future::Future<Output = ()> + Send + 'static,
{
let future = IntervalStream::new(actix_rt::time::interval(interval))
.for_each_concurrent(2, move |_| task());
@@ -207,4 +207,4 @@ async fn update_versions(
}
Ok(())
}
}