You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I try to use flask-socketio with gunicorn and at it works well. But when i try to use reload mod for debbuging, autoreload doesn't work on code changes. It happens only if i run socketio. I use eventlet as you recommend.
Example:
from flask import Flask
from flask_socketio import SocketIO
The text was updated successfully, but these errors were encountered:
Andrew-Rand
changed the title
Gunicorn reload option doesn't worl with flask-socketIO
Gunicorn reload option doesn't work with flask-socketIO
Sep 9, 2024
I have no control over when Gunicorn decides to reload. The Flask reloader is supported and to my knowledge works fine.
I use eventlet as you recommend.
I haven't recommended eventlet in the last several years. In fact eventlet is a bad choice to use because it is a dying project. See https://eventlet.readthedocs.io/en/latest/ for details.
Hello!
I try to use flask-socketio with gunicorn and at it works well. But when i try to use reload mod for debbuging, autoreload doesn't work on code changes. It happens only if i run socketio. I use eventlet as you recommend.
Example:
from flask import Flask
from flask_socketio import SocketIO
app = Flask('app')
socketio = SocketIO()
socketio.init_app(
app,
message_queue='redis://redis:6379/0',
logger=False,
engineio_logger=False,
cors_allowed_origins='*',
async_mode='eventlet',
)
socketio.run(app, port=5005)
run in terminal
gunicorn --worker-class eventlet -w 6 main:app --reload
My dependecies:
Python 3.11.9
flask==1.0.3
jinja2==2.11.2
packaging==21.3
gunicorn==22.0.0
markupsafe==1.1.1
itsdangerous==1.1.0
six==1.15.0
dnspython==2.1.0
eventlet==0.33.0
greenlet==2.0.2
flask-socketio==5.3.7
werkzeug==0.16.1
flask-redis==0.4.0
Thank you!
The text was updated successfully, but these errors were encountered: