move remaining runtime caches into their respective service

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-07-02 22:40:58 +00:00
parent e1d1dac95e
commit 473b29d524
12 changed files with 108 additions and 85 deletions

View file

@ -441,4 +441,17 @@ impl Service {
Ok(servers)
}
pub fn get_appservice_in_room_cache_usage(&self) -> (usize, usize) {
let cache = self.db.appservice_in_room_cache.read().expect("locked");
(cache.len(), cache.capacity())
}
pub fn clear_appservice_in_room_cache(&self) {
self.db
.appservice_in_room_cache
.write()
.expect("locked")
.clear();
}
}