add constructor for spaces service

Also adds a public function to invalidate the cache rather than exposing
the entire cache publicly.
This commit is contained in:
Charles Hall 2024-10-08 16:31:57 -07:00
parent f702b6cccd
commit f771d319b2
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
4 changed files with 19 additions and 16 deletions

View file

@ -3,9 +3,6 @@ use std::{
sync::{Arc, Mutex as StdMutex, OnceLock},
};
use lru_cache::LruCache;
use tokio::sync::Mutex;
use crate::{observability::FilterReloadHandles, Config, Result};
pub(crate) mod account_data;
@ -171,9 +168,7 @@ impl Services {
threads: rooms::threads::Service {
db,
},
spaces: rooms::spaces::Service {
roomid_spacechunk_cache: Mutex::new(LruCache::new(200)),
},
spaces: rooms::spaces::Service::new(200),
user: db,
},
transaction_ids: db,