mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 18:07:58 +00:00
Clean shutdown for subcommands (#6909)
This commit is contained in:
@@ -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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user