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:
parent
06b9c6a95f
commit
76a6b392ee
1 changed files with 1 additions and 1 deletions
|
@ -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()?
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue