Skip to content

Commit 48579d8

Browse files
authored
Bump aws_sdk_s3 version & provide sleep & retry impl for S3 client (#138)
Fixes #63
1 parent 2edc52f commit 48579d8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

server/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ actix-cors = "0.6"
1515
actix-files = "0.6.1"
1616
anyhow = { version = "1.0.43", features = ["backtrace"] }
1717
async-trait = "0.1"
18-
aws-sdk-s3 = "0.17"
18+
aws-sdk-s3 = "0.19"
19+
aws-smithy-async = { version = "0.49.0", features = ["rt-tokio"] }
1920
bytes = "1"
2021
chrono = "0.4.19"
2122
chrono-humanize = "0.2.2"

server/src/s3.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ use aws_sdk_s3::error::{HeadBucketError, HeadBucketErrorKind};
33
use aws_sdk_s3::model::{CommonPrefix, Delete, ObjectIdentifier};
44
use aws_sdk_s3::types::{ByteStream, SdkError};
55
use aws_sdk_s3::Error as AwsSdkError;
6+
use aws_sdk_s3::RetryConfig;
67
use aws_sdk_s3::{Client, Credentials, Endpoint, Region};
8+
use aws_smithy_async::rt::sleep::default_async_sleep;
79
use bytes::Bytes;
810
use crossterm::style::Stylize;
911
use datafusion::arrow::datatypes::Schema;
@@ -171,6 +173,8 @@ impl S3 {
171173
.region(options.region)
172174
.endpoint_resolver(options.endpoint)
173175
.credentials_provider(options.creds)
176+
.retry_config(RetryConfig::standard().with_max_attempts(5))
177+
.sleep_impl(default_async_sleep().expect("sleep impl is provided for tokio rt"))
174178
.build();
175179

176180
let client = Client::from_conf(config);

0 commit comments

Comments
 (0)