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

@ -1241,6 +1241,19 @@ impl Service {
debug!("Prepended backfill pdu");
Ok(())
}
pub fn get_lasttimelinecount_cache_usage(&self) -> (usize, usize) {
let cache = self.db.lasttimelinecount_cache.lock().expect("locked");
(cache.len(), cache.capacity())
}
pub fn clear_lasttimelinecount_cache(&self) {
self.db
.lasttimelinecount_cache
.lock()
.expect("locked")
.clear();
}
}
#[cfg(test)]