Skip to content

Commit da2e8b8

Browse files
committed
close stream in historic mode instead of returning EOF
1 parent bd42c2e commit da2e8b8

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/block_range_scanner.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@ pub enum Error {
127127

128128
#[error("WebSocket connection failed after {0} attempts")]
129129
WebSocketConnectionFailed(usize),
130-
131-
#[error("End of block batch")]
132-
Eof,
133130
}
134131

135132
#[derive(Debug)]
@@ -546,13 +543,9 @@ impl<N: Network> Service<N> {
546543
}
547544
}
548545

549-
info!(batch_count = batch_count, "Historical sync completed");
546+
info!(batch_count = batch_count, "Historical sync completed, closing the stream");
550547

551-
if let Some(sender) = &self.subscriber &&
552-
sender.send(Err(Error::Eof)).await.is_err()
553-
{
554-
warn!("Subscriber channel closed, cleaning up");
555-
}
548+
_ = self.subscriber.take();
556549

557550
Ok(())
558551
}

0 commit comments

Comments
 (0)