File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,9 @@ impl CdnBackend {
35
35
CdnKind :: CloudFront => {
36
36
let shared_config = runtime. block_on ( aws_config:: load_from_env ( ) ) ;
37
37
let config_builder = aws_sdk_cloudfront:: config:: Builder :: from ( & shared_config)
38
- . retry_config ( RetryConfig :: standard ( ) . with_max_attempts ( 3 ) )
38
+ . retry_config (
39
+ RetryConfig :: standard ( ) . with_max_attempts ( config. aws_sdk_max_retries ) ,
40
+ )
39
41
. region ( Region :: new ( config. s3_region . clone ( ) ) ) ;
40
42
41
43
Self :: CloudFront {
Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ pub struct Config {
20
20
// Storage params
21
21
pub ( crate ) storage_backend : StorageKind ,
22
22
23
+ // AWS SDK configuration
24
+ pub ( crate ) aws_sdk_max_retries : u32 ,
25
+
23
26
// S3 params
24
27
pub ( crate ) s3_bucket : String ,
25
28
pub ( crate ) s3_region : String ,
@@ -123,6 +126,8 @@ impl Config {
123
126
124
127
storage_backend : env ( "DOCSRS_STORAGE_BACKEND" , StorageKind :: Database ) ?,
125
128
129
+ aws_sdk_max_retries : env ( "DOCSRS_AWS_SDK_MAX_RETRIES" , 6 ) ?,
130
+
126
131
s3_bucket : env ( "DOCSRS_S3_BUCKET" , "rust-docs-rs" . to_string ( ) ) ?,
127
132
s3_region : env ( "S3_REGION" , "us-west-1" . to_string ( ) ) ?,
128
133
s3_endpoint : maybe_env ( "S3_ENDPOINT" ) ?,
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ impl S3Backend {
37
37
) -> Result < Self , Error > {
38
38
let shared_config = runtime. block_on ( aws_config:: load_from_env ( ) ) ;
39
39
let mut config_builder = aws_sdk_s3:: config:: Builder :: from ( & shared_config)
40
- . retry_config ( RetryConfig :: standard ( ) . with_max_attempts ( 6 ) )
40
+ . retry_config ( RetryConfig :: standard ( ) . with_max_attempts ( config . aws_sdk_max_retries ) )
41
41
. region ( Region :: new ( config. s3_region . clone ( ) ) ) ;
42
42
43
43
if let Some ( ref endpoint) = config. s3_endpoint {
You can’t perform that action at this time.
0 commit comments