de-wrapper max_fetch_prev_event; increase default config

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-10-22 00:09:55 +00:00 committed by strawberry
parent 0e55fa2de2
commit 167807e0a6
3 changed files with 5 additions and 5 deletions

View file

@ -1822,7 +1822,7 @@ fn default_appservice_idle_timeout() -> u64 { 300 }
fn default_pusher_idle_timeout() -> u64 { 15 }
fn default_max_fetch_prev_events() -> u16 { 100_u16 }
fn default_max_fetch_prev_events() -> u16 { 192_u16 }
fn default_tracing_flame_filter() -> String {
cfg!(debug_assertions)

View file

@ -171,8 +171,6 @@ impl Service {
#[inline]
pub fn server_name(&self) -> &ServerName { self.config.server_name.as_ref() }
pub fn max_fetch_prev_events(&self) -> u16 { self.config.max_fetch_prev_events }
pub fn allow_registration(&self) -> bool { self.config.allow_registration }
pub fn allow_guest_registration(&self) -> bool { self.config.allow_guest_registration }

View file

@ -13,7 +13,7 @@ use conduit::{
result::LogErr,
trace,
utils::{math::continue_exponential_backoff_secs, IterStream, MutexMap},
warn, Err, Error, PduEvent, Result,
warn, Err, Error, PduEvent, Result, Server,
};
use futures::{future, future::ready, FutureExt, StreamExt, TryFutureExt};
use ruma::{
@ -55,6 +55,7 @@ struct Services {
state_accessor: Dep<rooms::state_accessor::Service>,
state_compressor: Dep<rooms::state_compressor::Service>,
timeline: Dep<rooms::timeline::Service>,
server: Arc<Server>,
}
type RoomMutexMap = MutexMap<OwnedRoomId, ()>;
@ -76,6 +77,7 @@ impl crate::Service for Service {
state_accessor: args.depend::<rooms::state_accessor::Service>("rooms::state_accessor"),
state_compressor: args.depend::<rooms::state_compressor::Service>("rooms::state_compressor"),
timeline: args.depend::<rooms::timeline::Service>("rooms::timeline"),
server: args.server.clone(),
},
federation_handletime: HandleTimeMap::new().into(),
mutex_federation: RoomMutexMap::new(),
@ -1280,7 +1282,7 @@ impl Service {
{
check_room_id(room_id, &pdu)?;
let limit = self.services.globals.max_fetch_prev_events();
let limit = self.services.server.config.max_fetch_prev_events;
if amount > limit {
debug_warn!("Max prev event limit reached! Limit: {limit}");
graph.insert(prev_event_id.clone(), HashSet::new());