mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-07-30 11:48:31 +00:00
replace num_cpus dependency with available_parallelism()
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
d2aef071bc
commit
a537462d51
8 changed files with 22 additions and 13 deletions
|
@ -108,7 +108,8 @@ 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.db_cache_capacity_mb * 1024.0)
|
||||
/ ((conduit::utils::available_parallelism() 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