mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-18 00:01:24 +01:00
move shortstatekey_cache to service
This commit is contained in:
parent
190b788683
commit
d3b62e598d
4 changed files with 35 additions and 35 deletions
|
|
@ -7,11 +7,8 @@ use std::{
|
|||
sync::{Arc, Mutex, RwLock},
|
||||
};
|
||||
|
||||
use lru_cache::LruCache;
|
||||
use ruma::{
|
||||
events::{
|
||||
push_rules::PushRulesEvent, GlobalAccountDataEventType, StateEventType,
|
||||
},
|
||||
events::{push_rules::PushRulesEvent, GlobalAccountDataEventType},
|
||||
push::Ruleset,
|
||||
EventId, OwnedRoomId, OwnedUserId, RoomId, UserId,
|
||||
};
|
||||
|
|
@ -236,8 +233,6 @@ pub(crate) struct KeyValueDatabase {
|
|||
pub(super) senderkey_pusher: Arc<dyn KvTree>,
|
||||
|
||||
// Uncategorized trees
|
||||
pub(super) shortstatekey_cache:
|
||||
Mutex<LruCache<ShortStateKey, (StateEventType, String)>>,
|
||||
pub(super) our_real_users_cache:
|
||||
RwLock<HashMap<OwnedRoomId, Arc<HashSet<OwnedUserId>>>>,
|
||||
pub(super) appservice_in_room_cache:
|
||||
|
|
@ -461,14 +456,6 @@ impl KeyValueDatabase {
|
|||
global: builder.open_tree("global")?,
|
||||
server_signingkeys: builder.open_tree("server_signingkeys")?,
|
||||
|
||||
#[allow(
|
||||
clippy::as_conversions,
|
||||
clippy::cast_sign_loss,
|
||||
clippy::cast_possible_truncation
|
||||
)]
|
||||
shortstatekey_cache: Mutex::new(LruCache::new(
|
||||
(100_000.0 * config.cache_capacity_modifier) as usize,
|
||||
)),
|
||||
our_real_users_cache: RwLock::new(HashMap::new()),
|
||||
appservice_in_room_cache: RwLock::new(HashMap::new()),
|
||||
lasttimelinecount_cache: Mutex::new(HashMap::new()),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue