flask-uwsgi-websocket
flask-uwsgi-websocket copied to clipboard
Use in combination with flask-sqlalchemy
I am trying to use this in combination with flask-sqlalchemy, but I have noticed that after each request, a connection will stay open when I use the GeventWebSocket. This connection will not be closed for some reason.
Do you know the best way to manage connections when using flask-uwsgi-websocket in combination with flask-sqlalchemy+pymysql?
I do gevent.monkey.patch_all()
at the beginning of my websocket app, and I tried remove the database connection after each request using db.session.close()
and db.engine.dispose()
. But this did not seem to have any impact whatsoever.