Skip to content

Commit

Permalink
Add optional retry_config to FileStore::new
Browse files Browse the repository at this point in the history
  • Loading branch information
kurotych committed Dec 10, 2024
1 parent 4f5a52d commit 5484f91
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion file_store/src/file_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
settings::{self, Settings},
BytesMutStream, Error, FileInfo, FileInfoStream, Result,
};
use aws_config::{meta::region::RegionProviderChain, timeout::TimeoutConfig};
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;
Expand Down Expand Up @@ -64,6 +64,7 @@ impl FileStore {
endpoint: Option<String>,
region: Option<String>,
timeout_config: Option<TimeoutConfig>,
retry_config: Option<RetryConfig>,
) -> Result<Self> {
let endpoint: Option<Endpoint> = match &endpoint {
Some(endpoint) => Uri::from_str(endpoint)
Expand All @@ -84,6 +85,10 @@ impl FileStore {
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);
Expand Down

0 comments on commit 5484f91

Please sign in to comment.