mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Add a log statement when message-queue connection fails
This commit is contained in:
@@ -122,7 +122,13 @@ impl MessageQueue {
|
|||||||
}
|
}
|
||||||
first = false;
|
first = false;
|
||||||
|
|
||||||
let Ok(mut socket) = TcpStream::connect(&self.url).await else { continue };
|
let mut socket = match TcpStream::connect(&self.url).await {
|
||||||
|
Ok(socket) => socket,
|
||||||
|
Err(e) => {
|
||||||
|
log::warn!("couldn't connect to message-queue server: {e:?}");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
if !Self::send(&mut socket, msg.clone()).await {
|
if !Self::send(&mut socket, msg.clone()).await {
|
||||||
@@ -132,6 +138,7 @@ impl MessageQueue {
|
|||||||
continue 'outer;
|
continue 'outer;
|
||||||
};
|
};
|
||||||
// If there wasn't a message, check again in 1s
|
// If there wasn't a message, check again in 1s
|
||||||
|
// TODO: Use a notification system here
|
||||||
if status == 0 {
|
if status == 0 {
|
||||||
tokio::time::sleep(core::time::Duration::from_secs(1)).await;
|
tokio::time::sleep(core::time::Duration::from_secs(1)).await;
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user