Clean shutdown for subcommands (#6909)

This commit is contained in:
Cecile Tonglet
2020-08-20 16:38:00 +02:00
committed by GitHub
parent 6963272451
commit 6f59c95c89
+2 -4
View File
@@ -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,
@@ -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(())
}