mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 09:17:58 +00:00
Add cli param to limit database cache size (#1261)
* Add cli param to limit datbase cache size * fixing tests
This commit is contained in:
committed by
GitHub
parent
8606595a6d
commit
bd2a206e40
@@ -228,7 +228,10 @@ where
|
||||
.into();
|
||||
|
||||
config.database_path = db_path(&base_path, config.chain_spec.id()).to_string_lossy().into();
|
||||
|
||||
config.database_cache_size = match matches.value_of("database_cache_size") {
|
||||
Some(s) => Some(s.parse().map_err(|_| "Invalid Database Cache size specified")?),
|
||||
_=> None
|
||||
};
|
||||
config.pruning = match matches.value_of("pruning") {
|
||||
Some("archive") => PruningMode::ArchiveAll,
|
||||
None => PruningMode::default(),
|
||||
|
||||
@@ -45,6 +45,10 @@ pub struct CoreParams {
|
||||
#[structopt(long = "light")]
|
||||
light: bool,
|
||||
|
||||
/// Limit the memory the database cache can use
|
||||
#[structopt(long = "db-cache", value_name = "MiB")]
|
||||
database_cache_size: Option<u32>,
|
||||
|
||||
/// Listen on this multiaddress
|
||||
#[structopt(long = "listen-addr", value_name = "LISTEN_ADDR")]
|
||||
listen_addr: Vec<String>,
|
||||
|
||||
Reference in New Issue
Block a user