From bc7f2d09163ed3e0a44cee26b3d6e22b0f95b804 Mon Sep 17 00:00:00 2001 From: Max Kalashnikoff Date: Wed, 29 May 2024 09:59:41 +0100 Subject: [PATCH] fix: increasing rate-limiting threshold --- integration/integration.test.ts | 3 ++- src/state.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/integration/integration.test.ts b/integration/integration.test.ts index efba751..c78f440 100644 --- a/integration/integration.test.ts +++ b/integration/integration.test.ts @@ -77,7 +77,8 @@ describe('Echo Server', () => { // Simulate flood of requests and check for rate-limited responses it('Rate limiting', async () => { const url = `${BASE_URL}/rate_limit_test` - const requests_to_send = 100; + // x2.5 of the rate limit + const requests_to_send = 250; const promises = []; for (let i = 0; i < requests_to_send; i++) { promises.push( diff --git a/src/state.rs b/src/state.rs index 4539816..8949fc4 100644 --- a/src/state.rs +++ b/src/state.rs @@ -104,7 +104,7 @@ pub fn new_state( uptime: std::time::Instant::now(), http_client: reqwest::Client::new(), provider_cache: Cache::new(100), - rate_limit: rate_limit::RateLimiter::new(10, Duration::from_secs(60)), + rate_limit: rate_limit::RateLimiter::new(100, Duration::from_secs(60)), }) }