Skip to content

Commit

Permalink
ctrl_c not supported in simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
mystenmark committed Sep 19, 2022
1 parent 5cae68e commit 3c8ba2f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion crates/sui-benchmark/src/drivers/bench_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,17 @@ impl BenchDriver {
}
}

#[cfg(not(msim))]
async fn ctrl_c() -> std::io::Result<()> {
tokio::signal::ctrl_c().await
}

// TODO: if more use is made of tokio::signal we should just add support for it to the sim.
#[cfg(msim)]
async fn ctrl_c() -> std::io::Result<()> {
futures::future::pending().await
}

#[async_trait]
impl Driver<BenchmarkStats> for BenchDriver {
async fn run(
Expand Down Expand Up @@ -272,7 +283,7 @@ impl Driver<BenchmarkStats> for BenchDriver {
let mut stat_start_time: Instant = Instant::now();
loop {
tokio::select! {
_ = tokio::signal::ctrl_c() => {
_ = ctrl_c() => {
break;
}
_ = stat_interval.tick() => {
Expand Down

0 comments on commit 3c8ba2f

Please sign in to comment.