flask-uwsgi-websocket icon indicating copy to clipboard operation
flask-uwsgi-websocket copied to clipboard

Use in combination with flask-sqlalchemy

Open jaapz opened this issue 9 years ago • 0 comments

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.

jaapz avatar Jun 25 '15 08:06 jaapz