Handle a case when the session is closed during backoff connect

This commit is contained in:
DevilXD committed 2022-05-16 21:03:45 +02:00
1 parent 1bb1450ce8
commit 53d78f8a8d
1 file changed
+6
+6
View File
@@ -126,6 +126,12 @@ class Websocket:
f"Websocket[{self._idx}] connection error (sleep: {delay:.3}s)", exc_info=True
)
await asyncio.sleep(delay)
except RuntimeError:
ws_logger.warning(
f"Websocket[{self._idx}] exiting backoff connect loop "
"because session is closed (RuntimeError)"
)
break
@task_wrapper
async def _handle(self):