Version 2.3.8

Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
This commit is contained in:
Jeroen Oudshoorn
2023-09-12 00:24:14 +02:00
parent b391e8478f
commit 3fa8839626

View File

@ -39,23 +39,6 @@ class Client(object):
async def start_websocket(self, consumer):
s = "%s/events" % self.websocket
# while True:
# try:
# async with websockets.connect(s, ping_interval=60, ping_timeout=90) as ws:
# async for msg in ws:
# try:
# await consumer(msg)
# except Exception as ex:
# logging.debug("Error while parsing event (%s)", ex)
# except websockets.exceptions.ConnectionClosedError:
# logging.debug("Lost websocket connection. Reconnecting...")
# except websockets.exceptions.WebSocketException as wex:
# logging.debug("Websocket exception (%s)", wex)
# except OSError as e:
# logging.debug("Websocket OSError exception (%s) with parameter %s", e, s)
# except Exception as e:
# logging.debug("Other exception (%s) with parameter %s", e, s)
async with websockets.connect(s, ping_interval=60, ping_timeout=90) as ws:
# After the websocket connection is opened, loop waiting for messages
# Moved the websocket connection before the loop to avoid runaway websocket