mirror of
https://github.com/MarekWo/mc-webui.git
synced 2026-03-28 17:42:45 +01:00
perf: Switch SocketIO from gevent to threading mode
gevent async_mode requires monkey-patching at startup and was causing 6-12s page load times (vs 1-2s before). Threading mode doesn't require special setup and is sufficient for occasional Console commands. - Change async_mode from 'gevent' to 'threading' - Remove gevent/gevent-websocket from requirements (bridge has its own) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -46,7 +46,9 @@ def create_app():
|
||||
app.register_blueprint(api_bp)
|
||||
|
||||
# Initialize SocketIO with the app
|
||||
socketio.init_app(app, cors_allowed_origins="*", async_mode='gevent')
|
||||
# Using 'threading' mode for better compatibility with regular HTTP requests
|
||||
# (gevent mode requires monkey-patching and slows down non-WebSocket requests)
|
||||
socketio.init_app(app, cors_allowed_origins="*", async_mode='threading')
|
||||
|
||||
# Initialize archive scheduler if enabled
|
||||
if config.MC_ARCHIVE_ENABLED:
|
||||
|
||||
@@ -23,9 +23,7 @@ Pillow==10.1.0
|
||||
# HTTP Client for MeshCore Bridge communication
|
||||
requests==2.31.0
|
||||
|
||||
# WebSocket support for console
|
||||
# WebSocket support for console (threading mode - no gevent needed)
|
||||
flask-socketio==5.3.6
|
||||
python-socketio==5.10.0
|
||||
python-engineio==4.8.1
|
||||
gevent==23.9.1
|
||||
gevent-websocket==0.10.1
|
||||
|
||||
Reference in New Issue
Block a user