reduce reqwest timeout to 5s (#557)
This commit is contained in:
@@ -23,7 +23,7 @@ use plume_common::activity_pub::{
|
||||
use plume_common::utils;
|
||||
use reqwest::{
|
||||
header::{HeaderValue, ACCEPT},
|
||||
Client,
|
||||
ClientBuilder,
|
||||
};
|
||||
use rocket::{
|
||||
outcome::IntoOutcome,
|
||||
@@ -267,7 +267,9 @@ impl User {
|
||||
}
|
||||
|
||||
fn fetch(url: &str) -> Result<CustomPerson> {
|
||||
let mut res = Client::new()
|
||||
let mut res = ClientBuilder::new()
|
||||
.connect_timeout(Some(std::time::Duration::from_secs(5)))
|
||||
.build()?
|
||||
.get(url)
|
||||
.header(
|
||||
ACCEPT,
|
||||
@@ -369,7 +371,9 @@ impl User {
|
||||
}
|
||||
|
||||
pub fn fetch_outbox<T: Activity>(&self) -> Result<Vec<T>> {
|
||||
let mut res = Client::new()
|
||||
let mut res = ClientBuilder::new()
|
||||
.connect_timeout(Some(std::time::Duration::from_secs(5)))
|
||||
.build()?
|
||||
.get(&self.outbox_url[..])
|
||||
.header(
|
||||
ACCEPT,
|
||||
@@ -392,7 +396,9 @@ impl User {
|
||||
}
|
||||
|
||||
pub fn fetch_followers_ids(&self) -> Result<Vec<String>> {
|
||||
let mut res = Client::new()
|
||||
let mut res = ClientBuilder::new()
|
||||
.connect_timeout(Some(std::time::Duration::from_secs(5)))
|
||||
.build()?
|
||||
.get(&self.followers_endpoint[..])
|
||||
.header(
|
||||
ACCEPT,
|
||||
|
||||
Reference in New Issue
Block a user