reduce reqwest timeout to 5s (#557)

This commit is contained in:
fdb-hiroshima
2019-04-30 23:30:13 +02:00
committed by GitHub
parent 8f1ab3485e
commit 33a0c7dcd3
3 changed files with 30 additions and 16 deletions
+4 -1
View File
@@ -279,7 +279,10 @@ pub trait FromId<C>: Sized {
/// Dereferences an ID
fn deref(id: &str) -> Result<Self::Object, (Option<serde_json::Value>, Self::Error)> {
reqwest::Client::new()
reqwest::ClientBuilder::new()
.connect_timeout(Some(std::time::Duration::from_secs(5)))
.build()
.map_err(|_| (None, InboxError::DerefError.into()))?
.get(id)
.header(
ACCEPT,