mirror of
https://github.com/shiroyashik/sculptor.git
synced 2025-12-06 13:01:12 +03:00
use tracing_subscriber, handle subscription error
This commit is contained in:
parent
026c6a950e
commit
a5be9f187b
4 changed files with 156 additions and 25 deletions
|
|
@ -206,10 +206,21 @@ async fn subscribe(
|
|||
return;
|
||||
}
|
||||
msg = rx.recv() => {
|
||||
if socket.send(msg.unwrap()).await.is_err() {
|
||||
error!("Forced shutdown SUB due error!");
|
||||
return;
|
||||
};
|
||||
|
||||
let msg = msg.ok();
|
||||
|
||||
if let Some(msg) = msg {
|
||||
// debug!("[WebSocketSubscriber] Received: {msg}");
|
||||
if socket.send(msg.clone()).await.is_err() {
|
||||
error!("Forced shutdown SUB due error!");
|
||||
return;
|
||||
};
|
||||
}
|
||||
|
||||
// if socket.send(msg.unwrap()).await.is_err() {
|
||||
// error!("Forced shutdown SUB due error!");
|
||||
// return;
|
||||
// };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue