improvement: pdu cache, /sync cache

This commit is contained in:
Timo Kösters 2021-06-30 09:52:01 +02:00
parent dcac1361ec
commit 05821d6fd5
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
16 changed files with 424 additions and 243 deletions

View file

@ -17,6 +17,7 @@ use crate::{utils, Error, Result};
use abstraction::DatabaseEngine;
use directories::ProjectDirs;
use log::error;
use lru_cache::LruCache;
use rocket::futures::{channel::mpsc, stream::FuturesUnordered, StreamExt};
use ruma::{DeviceId, ServerName, UserId};
use serde::Deserialize;
@ -189,6 +190,7 @@ impl Database {
eventid_outlierpdu: builder.open_tree("eventid_outlierpdu")?,
prevevent_parent: builder.open_tree("prevevent_parent")?,
pdu_cache: RwLock::new(LruCache::new(1_000_000)),
},
account_data: account_data::AccountData {
roomuserdataid_accountdata: builder.open_tree("roomuserdataid_accountdata")?,