mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 11:07:56 +00:00
Make it possible to disable RocksDB completely (#11537)
* Make it possible to disable RocksDB completely * Make ParityDB non-optional * Address review comments
This commit is contained in:
@@ -220,6 +220,7 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
|
||||
let rocksdb_path = base_path.join("db").join(role_dir);
|
||||
let paritydb_path = base_path.join("paritydb").join(role_dir);
|
||||
Ok(match database {
|
||||
#[cfg(feature = "rocksdb")]
|
||||
Database::RocksDb => DatabaseSource::RocksDb { path: rocksdb_path, cache_size },
|
||||
Database::ParityDb => DatabaseSource::ParityDb { path: paritydb_path },
|
||||
Database::ParityDbDeprecated => {
|
||||
@@ -500,7 +501,16 @@ pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
|
||||
let net_config_dir = config_dir.join(DEFAULT_NETWORK_CONFIG_PATH);
|
||||
let client_id = C::client_id();
|
||||
let database_cache_size = self.database_cache_size()?.unwrap_or(1024);
|
||||
let database = self.database()?.unwrap_or(Database::RocksDb);
|
||||
let database = self.database()?.unwrap_or(
|
||||
#[cfg(feature = "rocksdb")]
|
||||
{
|
||||
Database::RocksDb
|
||||
},
|
||||
#[cfg(not(feature = "rocksdb"))]
|
||||
{
|
||||
Database::ParityDb
|
||||
},
|
||||
);
|
||||
let node_key = self.node_key(&net_config_dir)?;
|
||||
let role = self.role(is_dev)?;
|
||||
let max_runtime_instances = self.max_runtime_instances()?.unwrap_or(8);
|
||||
|
||||
Reference in New Issue
Block a user