From 0f4343acd2f15de4be5c58618d1a89a23104624e Mon Sep 17 00:00:00 2001 From: Matthew Frost Date: Sat, 2 Dec 2023 18:28:24 +0100 Subject: [PATCH] test --- app/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/__init__.py b/app/__init__.py index 18d0e4b..eda34d1 100644 --- a/app/__init__.py +++ b/app/__init__.py @@ -4,8 +4,9 @@ from flask import jsonify from app.settings import powerbars from app.utils import get_baytech_status_outlet from flask_socketio import SocketIO, emit +from gevent import monkey -socketio = SocketIO(engineio_logger=True, logger=True, cors_allowed_origins="*") +socketio = SocketIO(async_mode="gevent", logger=True, engineio_logger=True, cors_allowed_origins="*") @socketio.on('connect', namespace='/powerupdates') def connect_handler(): @@ -48,3 +49,5 @@ def not_authorised(e): def internal_server_error(e): return jsonify(error="Internal server error"), 500 +if not app.config["DEBUG"]: + monkey.patch_all()