From b6f64fa23b7c000f80f51759cac70a1305932e10 Mon Sep 17 00:00:00 2001 From: Benji Grant Date: Fri, 9 Jun 2023 23:20:51 +1000 Subject: [PATCH] Relax rate-limit --- api/src/main.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/api/src/main.rs b/api/src/main.rs index 7266f24..da3e2c3 100644 --- a/api/src/main.rs +++ b/api/src/main.rs @@ -61,9 +61,14 @@ async fn main() { ); // Rate limiting configuration (using tower_governor) - // From the docs: Allows bursts with up to eight requests and replenishes + // From the docs: Allows bursts with up to 20 requests and replenishes // one element after 500ms, based on peer IP. - let governor_config = Box::new(GovernorConfigBuilder::default().finish().unwrap()); + let governor_config = Box::new( + GovernorConfigBuilder::default() + .burst_size(20) + .finish() + .unwrap(), + ); let rate_limit = ServiceBuilder::new() // Handle errors from governor and convert into HTTP responses .layer(HandleErrorLayer::new(|e: BoxError| async move {