mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Remove the "expected" next ID
It's an unnecessary extra layer better handled locally.
This commit is contained in:
@@ -870,6 +870,7 @@ pub async fn handle_processors<D: Db, Pro: Processors, P: P2p>(
|
||||
// Alternatively, a peek method with local delineation of handled messages would work.
|
||||
|
||||
let msg = processors.recv().await;
|
||||
// TODO: Check this ID is sane (last handled ID or expected next ID)
|
||||
if last_msg == Some(msg.id) {
|
||||
sleep(Duration::from_secs(1)).await;
|
||||
continue;
|
||||
|
||||
@@ -28,8 +28,7 @@ impl Processors for Arc<MessageQueue> {
|
||||
self.queue(metadata, msg.into_bytes()).await;
|
||||
}
|
||||
async fn recv(&mut self) -> Message {
|
||||
// TODO: Use a proper expected next ID
|
||||
let msg = self.next(0).await;
|
||||
let msg = self.next().await;
|
||||
|
||||
let network = match msg.from {
|
||||
Service::Processor(network) => network,
|
||||
|
||||
Reference in New Issue
Block a user