Set deliverer timeout to 30 seconds
This commit is contained in:
parent
872fe8fef3
commit
0245eb59a2
2 changed files with 7 additions and 1 deletions
|
@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Set fetcher timeout to 3 minutes.
|
- Set fetcher timeout to 3 minutes.
|
||||||
|
- Set deliverer timeout to 30 seconds.
|
||||||
|
|
||||||
## [1.14.0] - 2023-02-22
|
## [1.14.0] - 2023-02-22
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,8 @@ use super::constants::AP_MEDIA_TYPE;
|
||||||
use super::identifiers::{local_actor_id, local_actor_key_id};
|
use super::identifiers::{local_actor_id, local_actor_key_id};
|
||||||
use super::queues::OutgoingActivityJobData;
|
use super::queues::OutgoingActivityJobData;
|
||||||
|
|
||||||
|
const DELIVERER_TIMEOUT: u64 = 30;
|
||||||
|
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(thiserror::Error, Debug)]
|
||||||
pub enum DelivererError {
|
pub enum DelivererError {
|
||||||
#[error("key error")]
|
#[error("key error")]
|
||||||
|
@ -65,7 +67,10 @@ fn build_client(instance: &Instance) -> reqwest::Result<Client> {
|
||||||
let proxy = Proxy::all(proxy_url)?;
|
let proxy = Proxy::all(proxy_url)?;
|
||||||
client_builder = client_builder.proxy(proxy);
|
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(
|
async fn send_activity(
|
||||||
|
|
Loading…
Reference in a new issue