diff --git a/file_store/src/file_store.rs b/file_store/src/file_store.rs index abecd1269..3ed43ada1 100644 --- a/file_store/src/file_store.rs +++ b/file_store/src/file_store.rs @@ -3,7 +3,7 @@ use crate::{ settings::{self, Settings}, BytesMutStream, Error, FileInfo, FileInfoStream, Result, }; -use aws_config::meta::region::RegionProviderChain; +use aws_config::{meta::region::RegionProviderChain, retry::RetryConfig, timeout::TimeoutConfig}; use aws_sdk_s3::{types::ByteStream, Client, Endpoint, Region}; use chrono::{DateTime, Utc}; use futures::FutureExt; @@ -63,6 +63,8 @@ impl FileStore { bucket: String, endpoint: Option, region: Option, + timeout_config: Option, + retry_config: Option, ) -> Result { let endpoint: Option = match &endpoint { Some(endpoint) => Uri::from_str(endpoint) @@ -79,6 +81,14 @@ impl FileStore { config = config.endpoint_resolver(endpoint); } + if let Some(timeout) = timeout_config { + config = config.timeout_config(timeout); + } + + if let Some(retry) = retry_config { + config = config.retry_config(retry); + } + let config = config.load().await; let client = Client::new(&config);