mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
fix: Correct federation timeouts
This commit is contained in:
@@ -340,7 +340,9 @@
|
|||||||
# this to be high to account for extremely large room joins, slow
|
# this to be high to account for extremely large room joins, slow
|
||||||
# homeservers, your own resources etc.
|
# homeservers, your own resources etc.
|
||||||
#
|
#
|
||||||
#federation_timeout = 300
|
# Joins have 6x the timeout.
|
||||||
|
#
|
||||||
|
#federation_timeout = 60
|
||||||
|
|
||||||
# MSC4284 Policy server request timeout (seconds). Generally policy
|
# MSC4284 Policy server request timeout (seconds). Generally policy
|
||||||
# servers should respond near instantly, however may slow down under
|
# servers should respond near instantly, however may slow down under
|
||||||
|
|||||||
@@ -435,7 +435,9 @@ pub struct Config {
|
|||||||
/// this to be high to account for extremely large room joins, slow
|
/// this to be high to account for extremely large room joins, slow
|
||||||
/// homeservers, your own resources etc.
|
/// homeservers, your own resources etc.
|
||||||
///
|
///
|
||||||
/// default: 300
|
/// Joins have 6x the timeout.
|
||||||
|
///
|
||||||
|
/// default: 60
|
||||||
#[serde(default = "default_federation_timeout")]
|
#[serde(default = "default_federation_timeout")]
|
||||||
pub federation_timeout: u64,
|
pub federation_timeout: u64,
|
||||||
|
|
||||||
@@ -2474,7 +2476,7 @@ fn default_well_known_timeout() -> u64 { 10 }
|
|||||||
|
|
||||||
fn default_federation_conn_timeout() -> u64 { 10 }
|
fn default_federation_conn_timeout() -> u64 { 10 }
|
||||||
|
|
||||||
fn default_federation_timeout() -> u64 { 25 }
|
fn default_federation_timeout() -> u64 { 60 }
|
||||||
|
|
||||||
fn default_policy_server_request_timeout() -> u64 { 10 }
|
fn default_policy_server_request_timeout() -> u64 { 10 }
|
||||||
|
|
||||||
|
|||||||
@@ -82,8 +82,13 @@ impl crate::Service for Service {
|
|||||||
synapse: base(config)?
|
synapse: base(config)?
|
||||||
.dns_resolver(resolver.resolver.hooked.clone())
|
.dns_resolver(resolver.resolver.hooked.clone())
|
||||||
.connect_timeout(Duration::from_secs(config.federation_conn_timeout))
|
.connect_timeout(Duration::from_secs(config.federation_conn_timeout))
|
||||||
.read_timeout(Duration::from_secs(305))
|
.read_timeout(Duration::from_secs(config.federation_timeout.saturating_mul(6)))
|
||||||
.timeout(Duration::from_secs(120))
|
.timeout(Duration::from_secs(
|
||||||
|
config
|
||||||
|
.federation_timeout
|
||||||
|
.saturating_mul(6)
|
||||||
|
.saturating_add(config.federation_conn_timeout),
|
||||||
|
))
|
||||||
.pool_max_idle_per_host(0)
|
.pool_max_idle_per_host(0)
|
||||||
.redirect(redirect::Policy::limited(3))
|
.redirect(redirect::Policy::limited(3))
|
||||||
.build()?,
|
.build()?,
|
||||||
|
|||||||
Reference in New Issue
Block a user