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
This commit is contained in:
Daniel García Moreno 2018-04-12 19:00:28 +02:00
parent 06b9c6a95f
commit 76a6b392ee

View file

@ -500,7 +500,7 @@ pub fn age_to_datetime(age: i64) -> DateTime<Local> {
pub fn json_q(method: &str, url: &Url, attrs: &JsonValue, timeout: u64) -> Result<JsonValue, Error> {
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()?
};