mirror of
https://github.com/openai/codex.git
synced 2026-04-28 02:11:08 +03:00
fix
This commit is contained in:
@@ -344,12 +344,10 @@ impl RealtimeWebsocketConnection {
|
||||
let Some(ws) = guard.as_ref() else {
|
||||
return Ok(());
|
||||
};
|
||||
if let Err(err) = ws.close().await {
|
||||
if !matches!(err, WsError::ConnectionClosed | WsError::AlreadyClosed) {
|
||||
return Err(ApiError::Stream(format!(
|
||||
"failed to close websocket: {err}"
|
||||
)));
|
||||
}
|
||||
if let Err(err) = ws.close().await
|
||||
&& !matches!(err, WsError::ConnectionClosed | WsError::AlreadyClosed)
|
||||
{
|
||||
return Err(ApiError::Stream(format!("failed to close websocket: {err}")));
|
||||
}
|
||||
*guard = None;
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user