Switch timeout APIs to use Duration.

This commit is contained in:
Jacob Hoffman-Andrews
2020-10-15 22:04:15 -07:00
committed by Martin Algesten
parent 00e3294ac1
commit 257d4e54dd
3 changed files with 24 additions and 34 deletions

View File

@@ -42,7 +42,7 @@ type Result<T> = result::Result<T, Oops>;
fn get(agent: &ureq::Agent, url: &String) -> Result<Vec<u8>> {
let response = agent
.get(url)
.timeout_connect(5_000)
.timeout_connect(std::time::Duration::from_secs(5))
.timeout(Duration::from_secs(20))
.call();
if let Some(err) = response.synthetic_error() {