From 432d0e968518c177a7b90e0d132399385b495786 Mon Sep 17 00:00:00 2001 From: ilya Date: Wed, 22 Nov 2023 22:04:49 +0000 Subject: [PATCH] Use default retries = 1 --- crates/solvers/src/boundary/rate_limiter.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/solvers/src/boundary/rate_limiter.rs b/crates/solvers/src/boundary/rate_limiter.rs index 3b60d15cb1..2fae7cf4f7 100644 --- a/crates/solvers/src/boundary/rate_limiter.rs +++ b/crates/solvers/src/boundary/rate_limiter.rs @@ -20,7 +20,7 @@ pub struct RateLimitingStrategy { max_retries: usize, } -const DEFAULT_MAX_RETIRES: usize = 2; +const DEFAULT_MAX_RETIRES: usize = 1; impl Default for RateLimitingStrategy { fn default() -> Self { @@ -129,7 +129,10 @@ mod tests { #[tokio::test] async fn test_execute_with_retries() { - let strategy = RateLimitingStrategy::default(); + let strategy = RateLimitingStrategy { + inner: SharedRateLimitingStrategy::default(), + max_retries: 2, + }; let rate_limiter = RateLimiter::new(strategy, "test".to_string()); let call_count = AtomicUsize::new(0); @@ -157,7 +160,10 @@ mod tests { #[tokio::test] async fn test_execute_with_retries_exceeds() { - let strategy = RateLimitingStrategy::default(); + let strategy = RateLimitingStrategy { + inner: SharedRateLimitingStrategy::default(), + max_retries: 2, + }; let rate_limiter = RateLimiter::new(strategy, "test".to_string()); let call_count = AtomicUsize::new(0);