Skip to content

Commit

Permalink
refactor: remove the node_exit_future routine
Browse files Browse the repository at this point in the history
  • Loading branch information
captainlee1024 committed May 13, 2024
1 parent 13db95d commit 2cf197f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/custom_reth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,18 @@ pub async fn launch_custom_node(
.await
.unwrap();

tokio::spawn(async move { handle.node_exit_future.await.map_err(|e| anyhow!(e)) });

stop_rx.recv().await;
tokio::select! {
_ = stop_rx.recv() => {
log::info!("Node stopped by signal");
}
r = handle.node_exit_future => {
if let Err(e) = r {
log::error!("Node stopped with error: {:?}", e);
} else {
log::info!("Node stopped");
}
}
}

Ok(())
}

0 comments on commit 2cf197f

Please sign in to comment.