Make wasm runtime cache size configurable (#10177)

* Make wasm runtime cache size configurable

* apply review comments

* remove VersionedRuntimeValue

* fix compilation

* VersionedRuntime: replace clone by Arc

* fmt

* fix warnings

* fix tests compilation

* fmt
This commit is contained in:
Éloïs
2021-12-09 16:10:16 +01:00
committed by GitHub
parent 6ce90f583c
commit 3acd335a8d
30 changed files with 139 additions and 79 deletions
@@ -238,6 +238,10 @@ pub struct RunCmd {
#[structopt(long)]
pub max_runtime_instances: Option<usize>,
/// Maximum number of different runtimes that can be cached.
#[structopt(long, default_value = "2")]
pub runtime_cache_size: u8,
/// Run a temporary node.
///
/// A temporary directory will be created to store the configuration and will be deleted
@@ -453,6 +457,10 @@ impl CliConfiguration for RunCmd {
Ok(self.max_runtime_instances.map(|x| x.min(256)))
}
fn runtime_cache_size(&self) -> Result<u8> {
Ok(self.runtime_cache_size)
}
fn base_path(&self) -> Result<Option<BasePath>> {
Ok(if self.tmp {
Some(BasePath::new_temp_dir()?)