From 88cdf6ed3db406b317017aee6a9b9fb7d8f37a7d Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Tue, 2 May 2023 19:03:19 -0300 Subject: [PATCH] Prevent websocket from disconnecting --- extensions/api/streaming_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/api/streaming_api.py b/extensions/api/streaming_api.py index c06facc..3b9ac65 100644 --- a/extensions/api/streaming_api.py +++ b/extensions/api/streaming_api.py @@ -56,7 +56,7 @@ async def _handle_connection(websocket, path): async def _run(host: str, port: int): - async with serve(_handle_connection, host, port): + async with serve(_handle_connection, host, port, ping_interval=None): await asyncio.Future() # run forever