Skip to content

Commit

Permalink
Allow disabling timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed Oct 13, 2023
1 parent 10aedaa commit 30e6ae8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions object_store/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,17 +396,37 @@ impl ClientOptions {
///
/// The timeout is applied from when the request starts connecting until the
/// response body has finished
///
/// Default is 5 seconds
pub fn with_timeout(mut self, timeout: Duration) -> Self {
self.timeout = Some(ConfigValue::Parsed(timeout));
self
}

/// Disables the request timeout
///
/// See [`Self::with_timeout`]
pub fn with_timeout_disabled(mut self) -> Self {
self.timeout = None;
self
}

/// Set a timeout for only the connect phase of a Client
///
/// Default is 5 seconds
pub fn with_connect_timeout(mut self, timeout: Duration) -> Self {
self.connect_timeout = Some(ConfigValue::Parsed(timeout));
self
}

/// Disables the connection timeout
///
/// See [`Self::with_connect_timeout`]
pub fn with_connect_timeout_disabled(mut self) -> Self {
self.timeout = None;
self
}

/// Set the pool max idle timeout
///
/// This is the length of time an idle connection will be kept alive
Expand Down

0 comments on commit 30e6ae8

Please sign in to comment.