From 2fc6c48ed428b36307e2e90ce00932af12c1ff86 Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Thu, 11 Sep 2025 00:00:34 -0700 Subject: [PATCH] Fix SocketIO WebSocket connections for production --- app/__init__.py | 1 + gunicorn_entry.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/__init__.py b/app/__init__.py index 2a212288d..62db29c20 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -104,6 +104,7 @@ redis_store = RedisClient() document_download_client = DocumentDownloadClient() socketio = SocketIO( + async_mode='gevent', cors_allowed_origins=[ config.Config.ADMIN_BASE_URL, ], diff --git a/gunicorn_entry.py b/gunicorn_entry.py index ab9a0d526..bcd32291d 100644 --- a/gunicorn_entry.py +++ b/gunicorn_entry.py @@ -2,4 +2,7 @@ from gevent import monkey monkey.patch_all() -from application import application # noqa +from application import application as flask_app # noqa +from app import socketio # noqa + +application = socketio