Set deliverer timeout to 30 seconds

This commit is contained in:
silverpill 2023-02-22 21:54:08 +00:00
parent 872fe8fef3
commit 0245eb59a2
2 changed files with 7 additions and 1 deletions

View file

@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added
- Set fetcher timeout to 3 minutes.
- Set deliverer timeout to 30 seconds.
## [1.14.0] - 2023-02-22

View file

@ -35,6 +35,8 @@ use super::constants::AP_MEDIA_TYPE;
use super::identifiers::{local_actor_id, local_actor_key_id};
use super::queues::OutgoingActivityJobData;
const DELIVERER_TIMEOUT: u64 = 30;
#[derive(thiserror::Error, Debug)]
pub enum DelivererError {
#[error("key error")]
@ -65,7 +67,10 @@ fn build_client(instance: &Instance) -> reqwest::Result<Client> {
let proxy = Proxy::all(proxy_url)?;
client_builder = client_builder.proxy(proxy);
};
client_builder.build()
let timeout = Duration::from_secs(DELIVERER_TIMEOUT);
client_builder
.timeout(timeout)
.build()
}
async fn send_activity(