mirror of
https://github.com/serai-dex/serai.git
synced 2025-04-16 11:11:56 +00:00
Add a log statement when message-queue connection fails
This commit is contained in:
parent
d0d3981731
commit
cbde0d8be9
1 changed files with 8 additions and 1 deletions
|
@ -122,7 +122,13 @@ impl MessageQueue {
|
|||
}
|
||||
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 {
|
||||
if !Self::send(&mut socket, msg.clone()).await {
|
||||
|
@ -132,6 +138,7 @@ impl MessageQueue {
|
|||
continue 'outer;
|
||||
};
|
||||
// If there wasn't a message, check again in 1s
|
||||
// TODO: Use a notification system here
|
||||
if status == 0 {
|
||||
tokio::time::sleep(core::time::Duration::from_secs(1)).await;
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue