Use blocking reqwest API in defer
defer, or, trait functions such as it in general(?) cannot be async (yet)
This commit is contained in:
@@ -279,7 +279,8 @@ pub trait FromId<C>: Sized {
|
||||
|
||||
/// Dereferences an ID
|
||||
fn deref(id: &str) -> Result<Self::Object, (Option<serde_json::Value>, Self::Error)> {
|
||||
reqwest::ClientBuilder::new()
|
||||
// Use blocking reqwest API here, since defer cannot be async (yet)
|
||||
reqwest::blocking::Client::builder()
|
||||
.connect_timeout(std::time::Duration::from_secs(5))
|
||||
.build()
|
||||
.map_err(|_| (None, InboxError::DerefError.into()))?
|
||||
|
||||
Reference in New Issue
Block a user