move shorteventid_cache to service

This commit is contained in:
Charles Hall 2024-09-30 21:06:37 -07:00
parent 7563360bee
commit 47502d1f36
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
4 changed files with 45 additions and 30 deletions

View file

@ -236,7 +236,6 @@ pub(crate) struct KeyValueDatabase {
pub(super) senderkey_pusher: Arc<dyn KvTree>,
// Uncategorized trees
pub(super) shorteventid_cache: Mutex<LruCache<ShortEventId, Arc<EventId>>>,
pub(super) auth_chain_cache:
Mutex<LruCache<Vec<ShortEventId>, Arc<HashSet<ShortEventId>>>>,
pub(super) eventidshort_cache: Mutex<LruCache<OwnedEventId, ShortEventId>>,
@ -480,14 +479,6 @@ impl KeyValueDatabase {
clippy::cast_sign_loss,
clippy::cast_possible_truncation
)]
shorteventid_cache: Mutex::new(LruCache::new(
(100_000.0 * config.cache_capacity_modifier) as usize,
)),
#[allow(
clippy::as_conversions,
clippy::cast_sign_loss,
clippy::cast_possible_truncation
)]
eventidshort_cache: Mutex::new(LruCache::new(
(100_000.0 * config.cache_capacity_modifier) as usize,
)),