Skip to content

Commit

Permalink
fix: increasing rate-limiting threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
geekbrother committed May 29, 2024
1 parent 3528578 commit bc7f2d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion integration/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
})
}

Expand Down

0 comments on commit bc7f2d0

Please sign in to comment.