mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Make message_queue::client::Client::send fallible
Allows tasks to report the errors themselves and handle retry in our standardized way.
This commit is contained in:
@@ -103,6 +103,7 @@ impl Coordinator {
|
||||
});
|
||||
|
||||
// Spawn a task to send messages to the message-queue
|
||||
// TODO: Define a proper task for this and remove use of queue_with_retry
|
||||
tokio::spawn({
|
||||
let mut db = db.clone();
|
||||
async move {
|
||||
@@ -115,12 +116,12 @@ impl Coordinator {
|
||||
to: Service::Coordinator,
|
||||
intent: borsh::from_slice::<messages::ProcessorMessage>(&msg).unwrap().intent(),
|
||||
};
|
||||
message_queue.queue(metadata, msg).await;
|
||||
message_queue.queue_with_retry(metadata, msg).await;
|
||||
txn.commit();
|
||||
}
|
||||
None => {
|
||||
let _ =
|
||||
tokio::time::timeout(core::time::Duration::from_secs(60), sent_message_recv.recv())
|
||||
tokio::time::timeout(core::time::Duration::from_secs(6), sent_message_recv.recv())
|
||||
.await;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user