-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v2' into dan/v2-nautilus-gas-price
- Loading branch information
Showing
5 changed files
with
27 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use std::time::Duration; | ||
|
||
use eyre::Result; | ||
use rusoto_core::{HttpClient, HttpConfig}; | ||
|
||
/// See https://github.com/hyperium/hyper/issues/2136#issuecomment-589488526 | ||
pub const HYPER_POOL_IDLE_TIMEOUT: Duration = Duration::from_secs(15); | ||
|
||
/// Create a new HTTP client with a timeout for the connection pool. | ||
/// This is a workaround for https://github.com/hyperium/hyper/issues/2136#issuecomment-589345238 | ||
pub fn http_client_with_timeout() -> Result<HttpClient> { | ||
let mut config = HttpConfig::new(); | ||
config.pool_idle_timeout(HYPER_POOL_IDLE_TIMEOUT); | ||
Ok(HttpClient::new_with_config(config)?) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters