Skip to content

Commit bdfddcf

Browse files
committed
merge
1 parent 4eba9ff commit bdfddcf

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/block_range_scanner.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,7 @@ pub enum Error {
128128
#[error("WebSocket connection failed after {0} attempts")]
129129
WebSocketConnectionFailed(usize),
130130

131-
#[error("End of block batch")]
132-
Eof,
133-
134-
#[error("Reorg detected")]
131+
#[error("Reorg Detected")]
135132
ReorgDetected,
136133
}
137134

@@ -447,7 +444,9 @@ impl<N: Network> Service<N> {
447444

448445
self.sync_historical_data(start_block, end_block).await?;
449446

450-
info!("Successfully synced historical data");
447+
_ = self.subscriber.take();
448+
449+
info!("Successfully synced historical data, closing the stream");
451450

452451
Ok(())
453452
}
@@ -555,12 +554,6 @@ impl<N: Network> Service<N> {
555554

556555
info!(batch_count = batch_count, "Historical sync completed");
557556

558-
if let Some(sender) = &self.subscriber &&
559-
sender.send(Err(Error::Eof)).await.is_err()
560-
{
561-
warn!("Subscriber channel closed, cleaning up");
562-
}
563-
564557
Ok(())
565558
}
566559

0 commit comments

Comments
 (0)