Skip to content

Commit

Permalink
ignoring send error during shutdown (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
vbar authored Jan 10, 2024
1 parent 1d4ebad commit 5d99146
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion state-reconstruct-fetcher/src/l1_fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,15 @@ impl L1Fetcher {
}

if let Some(tx_hash) = log.transaction_hash {
hash_tx.send(tx_hash).await.unwrap();
if let Err(e) = hash_tx.send(tx_hash).await {
if cancellation_token.is_cancelled() {
tracing::debug!("Shutting down tx sender...");
break;
} else {
tracing::error!("Cannot send tx hash: {e}");
continue;
}
}
}

latest_l2_block_number = new_l2_block_number;
Expand Down

0 comments on commit 5d99146

Please sign in to comment.