dont log EOF => reconnects

This commit is contained in:
Charlotte Som 2024-11-27 18:49:28 +02:00
parent 06f4ebf47f
commit f5e236fcf9

View file

@ -433,12 +433,10 @@ async fn host_subscription(server: Arc<RelayServer>, host: String) -> Result<()>
tracing::warn!("unexpected frame type {:?}", frame.opcode); tracing::warn!("unexpected frame type {:?}", frame.opcode);
} }
Err(e) => { Err(e) => {
tracing::error!("{e:?}"); if let WebSocketError::UnexpectedEOF = &e {
// TODO: should we try to reconnect in every situation?
if let WebSocketError::UnexpectedEOF = e {
tracing::debug!("got unexpected EOF. reconnecting immediately");
continue 'reconnect; continue 'reconnect;
} else { } else {
tracing::error!("{e:?}");
break 'reconnect; break 'reconnect;
} }
} }