Skip to content

Commit

Permalink
ignore websocket pongs
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyinstarlight committed Feb 23, 2024
1 parent 6461103 commit 1cc4d6a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ftc_stream_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,10 @@ async def run_websocket(uri):
while not stop.is_set():
try:
# try to get something from websocket and put it in queue for main thread (dropping events when queue is full)
comm.put_nowait(json.loads(await asyncio.wait_for(websocket.recv(), 0.2)))
message = await asyncio.wait_for(websocket.recv(), 0.2)
if message == "pong":
continue
comm.put_nowait(json.loads(message))
except (asyncio.TimeoutError, queue.Full):
pass

Expand Down

0 comments on commit 1cc4d6a

Please sign in to comment.