Skip to content

Commit 9b83b8b

Browse files
chore: s3 client builder (#895)
added separate variable for request time out to 300 secs and reverted connect time out to 5 secs
1 parent cbac074 commit 9b83b8b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

server/src/storage/s3.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ use super::{
5050
#[allow(dead_code)]
5151
// in bytes
5252
const MULTIPART_UPLOAD_SIZE: usize = 1024 * 1024 * 100;
53-
const CONNECT_TIMEOUT_SECS: u64 = 300;
53+
const CONNECT_TIMEOUT_SECS: u64 = 5;
54+
const REQUEST_TIMEOUT_SECS: u64 = 300;
5455
const AWS_CONTAINER_CREDENTIALS_RELATIVE_URI: &str = "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI";
5556

5657
#[derive(Debug, Clone, clap::Args)]
@@ -133,7 +134,8 @@ impl S3Config {
133134
fn get_default_builder(&self) -> AmazonS3Builder {
134135
let mut client_options = ClientOptions::default()
135136
.with_allow_http(true)
136-
.with_connect_timeout(Duration::from_secs(CONNECT_TIMEOUT_SECS));
137+
.with_connect_timeout(Duration::from_secs(CONNECT_TIMEOUT_SECS))
138+
.with_timeout(Duration::from_secs(REQUEST_TIMEOUT_SECS));
137139

138140
if self.skip_tls {
139141
client_options = client_options.with_allow_invalid_certificates(true)

0 commit comments

Comments
 (0)