Skip to content

Commit

Permalink
fix canon state stream
Browse files Browse the repository at this point in the history
  • Loading branch information
greged93 committed Jul 15, 2024
1 parent 71182cb commit 81fddfb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions crates/storage/provider/src/traits/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ impl Stream for CanonStateNotificationStream {
type Item = CanonStateNotification;

fn poll_next(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
loop {
return match ready!(self.as_mut().project().st.poll_next(cx)) {
Some(Ok(notification)) => Poll::Ready(Some(notification)),
Some(Err(err)) => {
debug!(%err, "canonical state notification stream lagging behind");
continue
}
None => Poll::Ready(None),
return match ready!(self.as_mut().project().st.poll_next(cx)) {
Some(Ok(notification)) => Poll::Ready(Some(notification)),
Some(Err(err)) => {
debug!(target: "provider::csu", %err, "canonical state notification stream lagging behind");

cx.waker().wake_by_ref();
Poll::Pending
}
None => Poll::Ready(None),
}
}
}
Expand Down

0 comments on commit 81fddfb

Please sign in to comment.