File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 2020)
2121
2222import nanoid
23- from websockets import ConnectionClosedOK
2423import websockets .asyncio .client
2524from aiochannel import Channel , ChannelEmpty , ChannelFull
2625from aiochannel .errors import ChannelClosed
2726from opentelemetry .trace import Span , use_span
2827from opentelemetry .trace .propagation .tracecontext import TraceContextTextMapPropagator
2928from pydantic import ValidationError
29+ from websockets import ConnectionClosedOK
3030from websockets .asyncio .client import ClientConnection
3131from websockets .exceptions import ConnectionClosed
3232
@@ -1335,6 +1335,9 @@ async def _recv_from_ws(
13351335 # is no @overrides in `websockets` to hint this.
13361336 try :
13371337 message = await ws .recv (decode = False )
1338+ except ConnectionClosedOK as e :
1339+ close_session (e )
1340+ continue
13381341 except ConnectionClosed :
13391342 # This triggers a break in the inner loop so we can get back to
13401343 # the outer loop.
You can’t perform that action at this time.
0 commit comments