mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-18 16:21:24 +01:00
Move database config to separate section
This renames: database_backend -> database.backend database_path -> database.path db_cache_capacity_mb -> database.cache_capacity_mb rocksdb_max_open_files -> database.rocksdb_max_open_files Charles updated the NixOS module. Co-authored-by: Charles Hall <charles@computer.surgery>
This commit is contained in:
parent
79d5d306cc
commit
d26b87a2f2
6 changed files with 39 additions and 28 deletions
|
|
@ -110,7 +110,7 @@ impl Engine {
|
|||
|
||||
impl KeyValueDatabaseEngine for Arc<Engine> {
|
||||
fn open(config: &Config) -> Result<Self> {
|
||||
let path = Path::new(&config.database_path).join(format!(
|
||||
let path = Path::new(&config.database.path).join(format!(
|
||||
"{}.db",
|
||||
if config.conduit_compat {
|
||||
"conduit"
|
||||
|
|
@ -130,9 +130,9 @@ impl KeyValueDatabaseEngine for Arc<Engine> {
|
|||
clippy::cast_precision_loss,
|
||||
clippy::cast_sign_loss
|
||||
)]
|
||||
let cache_size_per_thread = ((config.db_cache_capacity_mb * 1024.0)
|
||||
/ ((num_cpus::get() as f64 * 2.0) + 1.0))
|
||||
as u32;
|
||||
let cache_size_per_thread =
|
||||
((config.database.cache_capacity_mb * 1024.0)
|
||||
/ ((num_cpus::get() as f64 * 2.0) + 1.0)) as u32;
|
||||
|
||||
let writer =
|
||||
Mutex::new(Engine::prepare_conn(&path, cache_size_per_thread)?);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue