Fix a database connection leak which would happen while the application was under load. Peewee's documentation recommends managing database connections explicitly instead of using their autoconnect option, which defaults to True. Set autoconnect to False, and use the method recommended by the Flask documentation to manage connections.
Fix a database connection leak which would happen while the application was under load. Peewee's documentation recommends managing database connections explicitly instead of using their autoconnect option, which defaults to True. Set autoconnect to False, and use the method recommended by the Flask documentation to manage connections.
See: http://docs.peewee-orm.com/en/latest/peewee/database.html?highlight=connection#using-autoconnect https://flask.palletsprojects.com/en/1.1.x/appcontext/