move lasttimelinecount_cache to service

This commit is contained in:
Charles Hall 2024-10-08 14:40:54 -07:00
parent 107f4521e0
commit ce7efc1eff
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
4 changed files with 41 additions and 65 deletions

View file

@ -4,7 +4,7 @@ use std::{
io::Write,
mem::size_of,
path::Path,
sync::{Arc, Mutex},
sync::Arc,
};
use ruma::{
@ -21,7 +21,6 @@ use crate::{
rooms::{
short::{ShortEventId, ShortStateHash, ShortStateKey},
state_compressor::CompressedStateEvent,
timeline::PduCount,
},
},
services, utils, Config, Error, Result,
@ -231,9 +230,6 @@ pub(crate) struct KeyValueDatabase {
// Trees "owned" by `self::key_value::pusher`
pub(super) senderkey_pusher: Arc<dyn KvTree>,
// Uncategorized trees
pub(super) lasttimelinecount_cache: Mutex<HashMap<OwnedRoomId, PduCount>>,
}
impl KeyValueDatabase {
@ -451,8 +447,6 @@ impl KeyValueDatabase {
senderkey_pusher: builder.open_tree("senderkey_pusher")?,
global: builder.open_tree("global")?,
server_signingkeys: builder.open_tree("server_signingkeys")?,
lasttimelinecount_cache: Mutex::new(HashMap::new()),
};
Ok(db)