diff --git a/crates/common/src/config/smtp/queue.rs b/crates/common/src/config/smtp/queue.rs index 60499d76..6764084c 100644 --- a/crates/common/src/config/smtp/queue.rs +++ b/crates/common/src/config/smtp/queue.rs @@ -390,10 +390,12 @@ fn parse_queue_throttle(config: &mut Config) -> QueueThrottle { host: Vec::new(), outbound_concurrency: config .property_or_default::("queue.threads.remote", "25") - .unwrap_or(25), + .unwrap_or(25) + .max(1), local_concurrency: config .property_or_default::("queue.threads.local", "10") - .unwrap_or(10), + .unwrap_or(10) + .max(1), }; let all_throttles = parse_throttle( diff --git a/crates/store/src/backend/s3/mod.rs b/crates/store/src/backend/s3/mod.rs index df07ba4e..76bd9ac9 100644 --- a/crates/store/src/backend/s3/mod.rs +++ b/crates/store/src/backend/s3/mod.rs @@ -100,7 +100,7 @@ impl S3Store { 500..=599 if retries_left > 0 => { // wait backoff tokio::time::sleep(Duration::from_secs( - 1 << (self.max_retries - retries_left).max(6), + 1 << (self.max_retries - retries_left).min(6), )) .await; @@ -130,7 +130,7 @@ impl S3Store { 500..=599 if retries_left > 0 => { // wait backoff tokio::time::sleep(Duration::from_secs( - 1 << (self.max_retries - retries_left).max(6), + 1 << (self.max_retries - retries_left).min(6), )) .await; @@ -161,7 +161,7 @@ impl S3Store { 500..=599 if retries_left > 0 => { // wait backoff tokio::time::sleep(Duration::from_secs( - 1 << (self.max_retries - retries_left).max(6), + 1 << (self.max_retries - retries_left).min(6), )) .await;