feat: Add a config option to change the max TL size for legacy sync

This commit is contained in:
Ginger 2025-10-28 09:15:49 -04:00
parent 31cc888119
commit 1afa8413a2
4 changed files with 21 additions and 2 deletions

View file

@ -1196,6 +1196,13 @@
#
#typing_client_timeout_max_s = 45
# The maximum number of events to send at once for non-limited legacy syncs.
# Has no effect on sliding sync. This parameter also affects how many messages from each room
# are sent to the client on initial syncs, and larger values will make initial syncs slower.
# The default of 10 is reasonable for most use cases.
#
#incremental_sync_max_timeline_size = 10
# Set this to true for continuwuity to compress HTTP response bodies using
# zstd. This option does nothing if continuwuity was not built with
# `zstd_compression` feature. Please be aware that enabling HTTP

View file

@ -110,7 +110,7 @@ pub(super) async fn load_joined_room(
room_id,
previous_sync_end_count,
Some(next_batchcount),
10_usize,
services.config.incremental_sync_max_timeline_size,
);
let receipt_events = services

View file

@ -146,7 +146,7 @@ pub(super) async fn load_left_room(
room_id,
Some(timeline_start_count),
Some(timeline_end_count),
10_usize,
services.config.incremental_sync_max_timeline_size,
)
.await?;

View file

@ -1384,6 +1384,16 @@ pub struct Config {
#[serde(default = "default_typing_client_timeout_max_s")]
pub typing_client_timeout_max_s: u64,
/// The maximum number of events to send at once for non-limited legacy
/// syncs. Has no effect on sliding sync. This parameter also affects how
/// many messages from each room are sent to the client on initial syncs;
/// larger values will make initial syncs slower. The default of 10 is
/// reasonable for most use cases.
///
/// default: 10
#[serde(default = "default_incremental_sync_max_timeline_size")]
pub incremental_sync_max_timeline_size: usize,
/// Set this to true for continuwuity to compress HTTP response bodies using
/// zstd. This option does nothing if continuwuity was not built with
/// `zstd_compression` feature. Please be aware that enabling HTTP
@ -2449,6 +2459,8 @@ fn default_typing_client_timeout_min_s() -> u64 { 15 }
fn default_typing_client_timeout_max_s() -> u64 { 45 }
fn default_incremental_sync_max_timeline_size() -> usize { 10 }
fn default_rocksdb_recovery_mode() -> u8 { 1 }
fn default_rocksdb_log_level() -> String { "error".to_owned() }