dchatd: bugfix

shutdown p2p network only after other tasks have been shutdown
This commit is contained in:
draoi
2024-01-27 17:42:53 +01:00
parent 1deb70efc5
commit ffee76843a

View File

@@ -169,13 +169,15 @@ async fn realmain(args: Args, ex: Arc<smol::Executor<'static>>) -> Result<()> {
signals_handler.wait_termination(signals_task).await?;
info!("Caught termination signal, cleaning up and exiting...");
info!("Stopping P2P network");
p2p.stop().await;
info!("Stopping JSON-RPC server");
rpc_task.stop().await;
info!("Stopping dnet tasks");
dnet_task.stop().await;
info!("Stopping P2P network");
p2p.stop().await;
info!("Shut down successfully");
// ANCHOR_END: shutdown
Ok(())