experiment(app): make socketio server ping every 1s

This commit is contained in:
psychedelicious
2025-02-28 10:55:54 +10:00
parent 03ca83fe13
commit 61a22eb8cb

View File

@@ -90,7 +90,7 @@ class SocketIO:
_unsub_bulk_download = "unsubscribe_bulk_download"
def __init__(self, app: FastAPI):
self._sio = AsyncServer(async_mode="asgi", cors_allowed_origins="*")
self._sio = AsyncServer(async_mode="asgi", cors_allowed_origins="*", ping_interval=1)
self._app = ASGIApp(socketio_server=self._sio, socketio_path="/ws/socket.io")
app.mount("/ws", self._app)