Skip to content

Gunicorn reload option doesn't work with flask-socketIO #2089

Open
@Andrew-Rand

Description

@Andrew-Rand

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions