Attempt bug fix: S3 failing to retrieve resources.
This commit is contained in:
11
src/lib.rs
11
src/lib.rs
@@ -270,7 +270,13 @@ impl RequestFileContext {
|
|||||||
.bucket(&bucket_name)
|
.bucket(&bucket_name)
|
||||||
.key(&object_key)
|
.key(&object_key)
|
||||||
.send()
|
.send()
|
||||||
.await?;
|
.await
|
||||||
|
.map_err(|e| {
|
||||||
|
format!(
|
||||||
|
"failed to get S3 object bucket='{}' key='{}': {:?}",
|
||||||
|
bucket_name, object_key, e
|
||||||
|
)
|
||||||
|
})?;
|
||||||
let mut stream = response.body.into_async_read();
|
let mut stream = response.body.into_async_read();
|
||||||
let mut bytes = Vec::new();
|
let mut bytes = Vec::new();
|
||||||
stream.read_to_end(&mut bytes).await?;
|
stream.read_to_end(&mut bytes).await?;
|
||||||
@@ -415,13 +421,14 @@ async fn fetch_s3_client_from_sys_map() -> Result<Arc<Client>, AnyError> {
|
|||||||
secret_key,
|
secret_key,
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
"sys-map",
|
"pass",
|
||||||
))
|
))
|
||||||
.load()
|
.load()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
let s3_config = aws_sdk_s3::config::Builder::from(&shared_config)
|
let s3_config = aws_sdk_s3::config::Builder::from(&shared_config)
|
||||||
.endpoint_url(format!("https://{}", host))
|
.endpoint_url(format!("https://{}", host))
|
||||||
|
.force_path_style(true)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
Ok(Arc::new(Client::from_conf(s3_config)))
|
Ok(Arc::new(Client::from_conf(s3_config)))
|
||||||
|
|||||||
Reference in New Issue
Block a user