mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
move pdu_cache to service
This commit is contained in:
parent
fb534d8140
commit
7563360bee
6 changed files with 44 additions and 40 deletions
|
|
@ -27,7 +27,7 @@ use crate::{
|
|||
timeline::PduCount,
|
||||
},
|
||||
},
|
||||
services, utils, Config, Error, PduEvent, Result,
|
||||
services, utils, Config, Error, Result,
|
||||
};
|
||||
|
||||
pub(crate) mod abstraction;
|
||||
|
|
@ -236,7 +236,6 @@ pub(crate) struct KeyValueDatabase {
|
|||
pub(super) senderkey_pusher: Arc<dyn KvTree>,
|
||||
|
||||
// Uncategorized trees
|
||||
pub(super) pdu_cache: Mutex<LruCache<OwnedEventId, Arc<PduEvent>>>,
|
||||
pub(super) shorteventid_cache: Mutex<LruCache<ShortEventId, Arc<EventId>>>,
|
||||
pub(super) auth_chain_cache:
|
||||
Mutex<LruCache<Vec<ShortEventId>, Arc<HashSet<ShortEventId>>>>,
|
||||
|
|
@ -468,12 +467,6 @@ impl KeyValueDatabase {
|
|||
global: builder.open_tree("global")?,
|
||||
server_signingkeys: builder.open_tree("server_signingkeys")?,
|
||||
|
||||
pdu_cache: Mutex::new(LruCache::new(
|
||||
config
|
||||
.pdu_cache_capacity
|
||||
.try_into()
|
||||
.expect("pdu cache capacity fits into usize"),
|
||||
)),
|
||||
#[allow(
|
||||
clippy::as_conversions,
|
||||
clippy::cast_sign_loss,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue