Skip to content

Commit

Permalink
Fix hardware benchmarks always running (#739)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmpolaczyk authored Nov 4, 2024
1 parent 575f7b9 commit 94b94cc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion container-chains/nodes/frontier/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ pub fn run() -> Result<()> {

runner.run_node_until_exit(|config| async move {
let relaychain_args = cli.relaychain_args();
let hwbench = (!cli.no_hardware_benchmarks).then_some(
let hwbench = (!cli.no_hardware_benchmarks).then(||
config.database.path().map(|database_path| {
let _ = std::fs::create_dir_all(database_path);
sc_sysinfo::gather_hwbench(Some(database_path))
Expand Down
2 changes: 1 addition & 1 deletion container-chains/nodes/simple/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ pub fn run() -> Result<()> {
let collator_options = cli.run.collator_options();

runner.run_node_until_exit(|config| async move {
let hwbench = (!cli.no_hardware_benchmarks).then_some(
let hwbench = (!cli.no_hardware_benchmarks).then(||
config.database.path().map(|database_path| {
let _ = std::fs::create_dir_all(database_path);
sc_sysinfo::gather_hwbench(Some(database_path))
Expand Down
12 changes: 7 additions & 5 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,12 @@ pub fn run() -> Result<()> {
.as_ref()
.expect("base_path is always set");
let hwbench = (!cmd.no_hardware_benchmarks)
.then_some(Some(containers_base_path).map(|database_path| {
let _ = std::fs::create_dir_all(database_path);
sc_sysinfo::gather_hwbench(Some(database_path))
}))
.then(|| {
Some(containers_base_path).map(|database_path| {
let _ = std::fs::create_dir_all(database_path);
sc_sysinfo::gather_hwbench(Some(database_path))
})
})
.flatten();

let polkadot_cli = solochain::relay_chain_cli_new(
Expand Down Expand Up @@ -413,7 +415,7 @@ pub fn run() -> Result<()> {
let collator_options = cli.run.collator_options();

runner.run_node_until_exit(|config| async move {
let hwbench = (!cli.no_hardware_benchmarks).then_some(
let hwbench = (!cli.no_hardware_benchmarks).then(||
config.database.path().map(|database_path| {
let _ = std::fs::create_dir_all(database_path);
sc_sysinfo::gather_hwbench(Some(database_path))
Expand Down
10 changes: 6 additions & 4 deletions solo-chains/client/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,12 @@ where

runner.run_node_until_exit(move |config| async move {
let hwbench = (!cli.run.no_hardware_benchmarks)
.then_some(config.database.path().map(|database_path| {
let _ = std::fs::create_dir_all(database_path);
sc_sysinfo::gather_hwbench(Some(database_path))
}))
.then(|| {
config.database.path().map(|database_path| {
let _ = std::fs::create_dir_all(database_path);
sc_sysinfo::gather_hwbench(Some(database_path))
})
})
.flatten();

let database_source = config.database.clone();
Expand Down

0 comments on commit 94b94cc

Please sign in to comment.