add eventid_pdu database cf cache

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-11-21 23:45:16 -05:00
parent b6d53e97a6
commit 9100af9974
No known key found for this signature in database
2 changed files with 14 additions and 0 deletions

View file

@ -198,6 +198,10 @@ pub struct Config {
#[serde(default = "default_eventidshort_cache_capacity")]
pub eventidshort_cache_capacity: u32,
/// default: varies by system
#[serde(default = "default_eventid_pdu_cache_capacity")]
pub eventid_pdu_cache_capacity: u32,
/// default: varies by system
#[serde(default = "default_shortstatekey_cache_capacity")]
pub shortstatekey_cache_capacity: u32,
@ -2040,6 +2044,8 @@ fn default_shorteventid_cache_capacity() -> u32 { parallelism_scaled_u32(50_000)
fn default_eventidshort_cache_capacity() -> u32 { parallelism_scaled_u32(25_000).saturating_add(100_000) }
fn default_eventid_pdu_cache_capacity() -> u32 { parallelism_scaled_u32(25_000).saturating_add(100_000) }
fn default_shortstatekey_cache_capacity() -> u32 { parallelism_scaled_u32(10_000).saturating_add(100_000) }
fn default_statekeyshort_cache_capacity() -> u32 { parallelism_scaled_u32(10_000).saturating_add(100_000) }

View file

@ -136,6 +136,14 @@ pub(crate) fn cf_options(
cache_size(cfg, cfg.eventidshort_cache_capacity, 64)?,
),
"eventid_pduid" => set_table_with_new_cache(
&mut opts,
cfg,
cache,
name,
cache_size(cfg, cfg.eventid_pdu_cache_capacity, 64)?,
),
"shorteventid_authchain" => {
set_table_with_new_cache(
&mut opts,