Remove nested try block
This commit is contained in:
parent
04b31f6a55
commit
e44fa4f72b
21
ws_proxy.py
21
ws_proxy.py
@ -31,17 +31,16 @@ class WebSocketProxy:
|
||||
|
||||
provider_ws, provider_session = provider_connection
|
||||
|
||||
try:
|
||||
await asyncio.gather(
|
||||
self._proxy_client_to_provider(ws, provider_ws, provider),
|
||||
self._proxy_provider_to_client(provider_ws, ws, provider),
|
||||
return_exceptions=True
|
||||
)
|
||||
finally:
|
||||
# Clean up provider connection
|
||||
if not provider_ws.closed:
|
||||
await provider_ws.close()
|
||||
await provider_session.close()
|
||||
await asyncio.gather(
|
||||
self._proxy_client_to_provider(ws, provider_ws, provider),
|
||||
self._proxy_provider_to_client(provider_ws, ws, provider),
|
||||
return_exceptions=True
|
||||
)
|
||||
|
||||
# Clean up provider connection
|
||||
if not provider_ws.closed:
|
||||
await provider_ws.close()
|
||||
await provider_session.close()
|
||||
|
||||
except Exception as e:
|
||||
self.logger.error(f"WebSocket proxy error: {e}")
|
||||
|
Loading…
Reference in New Issue
Block a user