Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Clean shutdown for subcommands (#6909)
Browse files Browse the repository at this point in the history
  • Loading branch information
cecton authored Aug 20, 2020
1 parent 6e098a1 commit 9c679b3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions client/cli/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub fn build_runtime() -> std::result::Result<tokio::runtime::Runtime, std::io::
fn run_until_exit<FUT, ERR>(
mut tokio_runtime: tokio::runtime::Runtime,
future: FUT,
mut task_manager: TaskManager,
task_manager: TaskManager,
) -> Result<()>
where
FUT: Future<Output = std::result::Result<(), ERR>> + future::Future,
Expand All @@ -106,9 +106,7 @@ where
pin_mut!(f);

tokio_runtime.block_on(main(f)).map_err(|e| e.to_string())?;

task_manager.terminate();
drop(tokio_runtime);
tokio_runtime.block_on(task_manager.clean_shutdown());

Ok(())
}
Expand Down

0 comments on commit 9c679b3

Please sign in to comment.