Skip to content

Commit

Permalink
chore(consensus): remove unwrap from join handle await
Browse files Browse the repository at this point in the history
  • Loading branch information
matthias-wright committed May 10, 2024
1 parent 276b6ab commit 892c733
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions core/consensus/src/edge_node/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use quick_cache::unsync::Cache;
use tokio::pin;
use tokio::sync::{mpsc, Notify};
use tokio::task::JoinHandle;
use tracing::info;
use tracing::{error, info};

use super::transaction_store::{NotExecuted, TransactionStore};
use crate::consensus::PubSubMsg;
Expand Down Expand Up @@ -57,7 +57,13 @@ impl EdgeConsensus {
self.tx_shutdown.notify_one();

// Gracefully wait for all the subtasks to finish and return.
self.handle.await.unwrap();
if let Err(e) = self.handle.await {
error!(
"Failed to join handle in file {} at line {}: {e}",
file!(),
line!()
);
}
}
}

Expand Down

0 comments on commit 892c733

Please sign in to comment.