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
@@ -1331,6 +1331,9 @@ async def _recv_from_ws(
13311331 # is no @overrides in `websockets` to hint this.
13321332 try :
13331333 message = await ws .recv (decode = False )
1334+ except ConnectionClosedOK as e :
1335+ close_session (e )
1336+ continue
13341337 except ConnectionClosed :
13351338 # This triggers a break in the inner loop so we can get back to
13361339 # the outer loop.
You can’t perform that action at this time.
0 commit comments