Fix graceful shutdown skipped if future ends with error (#6769)

* Initial commit

Forked at: 5060324b91
Parent branch: origin/master

* Fix graceful shutdown skipped if future ends with error

* apply suggestion
This commit is contained in:
Cecile Tonglet
2020-07-30 17:59:07 +02:00
committed by GitHub
parent 01d0d13fad
commit 3d42e2c7eb
+2 -3
View File
@@ -229,10 +229,9 @@ impl<C: SubstrateCli> Runner<C> {
) -> Result<()> {
self.print_node_infos();
let mut task_manager = initialise(self.config)?;
self.tokio_runtime.block_on(main(task_manager.future().fuse()))
.map_err(|e| e.to_string())?;
let res = self.tokio_runtime.block_on(main(task_manager.future().fuse()));
self.tokio_runtime.block_on(task_manager.clean_shutdown());
Ok(())
res.map_err(|e| e.to_string().into())
}
/// A helper function that runs a command with the configuration of this node