Skip to content

Commit 0ab15cc

Browse files
committed
allow for range processor to stop before the main thread
1 parent 5a3f0be commit 0ab15cc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/event_scanner/scanner/common.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,10 @@ fn spawn_log_consumers_in_stream_mode<N: Network>(
147147
loop {
148148
match range_rx.recv().await {
149149
Ok(message) => {
150-
tx.send(message).await.expect("receiver dropped only if we exit this loop");
150+
if tx.send(message).await.is_err() {
151+
debug!("Range processor dropped, stopping range reception");
152+
break;
153+
}
151154
}
152155
Err(RecvError::Closed) => {
153156
debug!("No more block ranges to receive");

0 commit comments

Comments
 (0)