Use CLI to configure max instances cache (#5177)

* Use CLI to configure max instances cache

* Fix tests

* Move default value into CLI

* Use SmallVec

* Apply review comments

* Get rid of `SmallVec`

Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
Stanislav Tkach
2020-03-11 10:43:37 +02:00
committed by GitHub
parent f21680209f
commit 93ee3104e7
23 changed files with 139 additions and 71 deletions
+9 -1
View File
@@ -265,7 +265,13 @@ pub struct RunCmd {
parse(from_os_str),
conflicts_with_all = &[ "password-interactive", "password" ]
)]
pub password_filename: Option<PathBuf>
pub password_filename: Option<PathBuf>,
/// The size of the instances cache for each runtime.
///
/// The default value is 8 and the values higher than 256 are ignored.
#[structopt(long = "max-runtime-instances", default_value = "8")]
pub max_runtime_instances: usize,
}
impl RunCmd {
@@ -435,6 +441,8 @@ impl RunCmd {
// Imply forced authoring on --dev
config.force_authoring = self.shared_params.dev || self.force_authoring;
config.max_runtime_instances = self.max_runtime_instances.min(256);
Ok(())
}