diff --git a/rust-bins/duniter-cli/src/duniter_ts_args.rs b/rust-bins/duniter-cli/src/duniter_ts_args.rs index a190d4eb0647aa88f505d352518d9bdf8dc45378..765630419fe30682505b90c6928f112764432fbe 100644 --- a/rust-bins/duniter-cli/src/duniter_ts_args.rs +++ b/rust-bins/duniter-cli/src/duniter_ts_args.rs @@ -43,7 +43,11 @@ pub(crate) fn gen_duniter_ts_args( duniter_js_exe: String, log_level_filter: log::LevelFilter, ) -> Vec<String> { - let mut duniter_ts_args = vec!["--max-old-space-size=4096".to_owned(), duniter_js_exe]; + let max_old_space_size = args.max_old_space_size.unwrap_or(4096); + let mut duniter_ts_args = vec![ + format!("--max-old-space-size={}", max_old_space_size), + duniter_js_exe, + ]; if let Some(ref home) = args.home { duniter_ts_args.push("--home".to_owned()); duniter_ts_args.push(home.to_str().expect("invalid home path").to_owned()); diff --git a/rust-bins/duniter-cli/src/main.rs b/rust-bins/duniter-cli/src/main.rs index f10642420db2f64c79737d64319944cba1790121..cdab0d8d3d0948580b2ed79e208dc040255ae579 100644 --- a/rust-bins/duniter-cli/src/main.rs +++ b/rust-bins/duniter-cli/src/main.rs @@ -64,6 +64,8 @@ struct DuniterArgs { /// Logs level (If not specified, use the logs level defined in the configuration or INFO by default). #[structopt(short, long, alias("loglevel"), case_insensitive(true), possible_values = &["OFF", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"])] log: Option<log::LevelFilter>, + #[structopt(long, hidden = true)] + max_old_space_size: Option<usize>, /// Profile name (default "duniter_default") #[structopt(short, long, alias("mdb"))] profile: Option<String>,