mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-19 18:05:41 +00:00
Make sure we poll authority event stream until all events are processed (#5608)
* Make sure we poll authority event stream until all events are processed * Add test
This commit is contained in:
@@ -538,21 +538,19 @@ where
|
||||
Ok(())
|
||||
};
|
||||
|
||||
match inner() {
|
||||
Ok(()) => {}
|
||||
loop {
|
||||
match inner() {
|
||||
Ok(()) => return Poll::Pending,
|
||||
|
||||
// Handle fatal errors.
|
||||
//
|
||||
// Given that the network likely terminated authority discovery should do the same.
|
||||
Err(Error::DhtEventStreamTerminated) => return Poll::Ready(()),
|
||||
// Handle fatal errors.
|
||||
//
|
||||
// Given that the network likely terminated authority discovery should do the same.
|
||||
Err(Error::DhtEventStreamTerminated) => return Poll::Ready(()),
|
||||
|
||||
// Handle non-fatal errors.
|
||||
Err(e) => error!(target: "sub-authority-discovery", "Poll failure: {:?}", e),
|
||||
};
|
||||
|
||||
// Return Poll::Pending as this is a long running task with the same lifetime as the node
|
||||
// itself.
|
||||
Poll::Pending
|
||||
// Handle non-fatal errors.
|
||||
Err(e) => error!(target: "sub-authority-discovery", "Poll failure: {:?}", e),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user