From 76a6b392ee30e5eab5da44159445813b8f6991a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Moreno?= Date: Thu, 12 Apr 2018 19:00:28 +0200 Subject: [PATCH] Fix request with no timeout reqwest use a default timeout of 30 seconds, so for no timeout we need to provide a timeout of None. https://docs.rs/reqwest/0.8.5/reqwest/struct.ClientBuilder.html#method.timeout This should fix #171 --- fractal-api/src/util.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fractal-api/src/util.rs b/fractal-api/src/util.rs index a461f8e6..6a25d3db 100644 --- a/fractal-api/src/util.rs +++ b/fractal-api/src/util.rs @@ -500,7 +500,7 @@ pub fn age_to_datetime(age: i64) -> DateTime { pub fn json_q(method: &str, url: &Url, attrs: &JsonValue, timeout: u64) -> Result { let mut clientb = reqwest::ClientBuilder::new(); let client = match timeout { - 0 => clientb.build()?, + 0 => clientb.timeout(None).build()?, n => clientb.timeout(StdDuration::from_secs(n)).build()? };