improvement: better appservice compatibility and optimizations

This commit is contained in:
Timo Kösters 2021-02-06 15:27:43 +01:00
parent fd3fb3a7ed
commit 6924dfc8ea
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
9 changed files with 270 additions and 207 deletions

View file

@ -27,7 +27,7 @@ pub struct Config {
server_name: Box<ServerName>,
database_path: String,
#[serde(default = "default_cache_capacity")]
cache_capacity: u64,
cache_capacity: u32,
#[serde(default = "default_max_request_size")]
max_request_size: u32,
#[serde(default = "default_max_concurrent_requests")]
@ -48,7 +48,7 @@ fn true_fn() -> bool {
true
}
fn default_cache_capacity() -> u64 {
fn default_cache_capacity() -> u32 {
1024 * 1024 * 1024
}
@ -93,8 +93,7 @@ impl Database {
pub async fn load_or_create(config: Config) -> Result<Self> {
let db = sled::Config::default()
.path(&config.database_path)
.cache_capacity(config.cache_capacity)
.print_profile_on_drop(false)
.cache_capacity(config.cache_capacity as u64)
.open()?;
info!("Opened sled database at {}", config.database_path);