[pbs-devel] [PATCH proxmox 3/3] s3-client: expose default timeout for s3 api requests
Christian Ebner
c.ebner at proxmox.com
Wed Aug 20 11:58:05 CEST 2025
Make the default timeout public, so it can be reused for put object
requests in Proxmox Backup Server.
Signed-off-by: Christian Ebner <c.ebner at proxmox.com>
---
proxmox-s3-client/src/client.rs | 4 +++-
proxmox-s3-client/src/lib.rs | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/proxmox-s3-client/src/client.rs b/proxmox-s3-client/src/client.rs
index 8a551f3a..871cd3fa 100644
--- a/proxmox-s3-client/src/client.rs
+++ b/proxmox-s3-client/src/client.rs
@@ -31,8 +31,10 @@ use crate::response_reader::{
ListBucketsResponse, ListObjectsV2Response, PutObjectResponse, ResponseReader,
};
+/// Default timeout for s3 api requests.
+pub const S3_HTTP_REQUEST_TIMEOUT: Duration = Duration::from_secs(60);
+
const S3_HTTP_CONNECT_TIMEOUT: Duration = Duration::from_secs(10);
-const S3_HTTP_REQUEST_TIMEOUT: Duration = Duration::from_secs(60);
const S3_TCP_KEEPALIVE_TIME: u32 = 120;
const MAX_S3_UPLOAD_RETRY: usize = 3;
// Assumed minimum upload rate of 1 KiB/s for dynamic put object request timeout calculation.
diff --git a/proxmox-s3-client/src/lib.rs b/proxmox-s3-client/src/lib.rs
index f485ac46..26e7032b 100644
--- a/proxmox-s3-client/src/lib.rs
+++ b/proxmox-s3-client/src/lib.rs
@@ -20,7 +20,7 @@ pub use aws_sign_v4::uri_decode;
#[cfg(feature = "impl")]
mod client;
#[cfg(feature = "impl")]
-pub use client::{S3Client, S3ClientOptions, S3PathPrefix};
+pub use client::{S3Client, S3ClientOptions, S3PathPrefix, S3_HTTP_REQUEST_TIMEOUT};
#[cfg(feature = "impl")]
mod timestamps;
#[cfg(feature = "impl")]
--
2.47.2
More information about the pbs-devel
mailing list