Add db connection pooling

This commit is contained in:
Peter Stockings
2025-07-23 21:58:43 +10:00
parent b5acb9e93e
commit a4c29e0d8f
3 changed files with 47 additions and 32 deletions

4
app.py
View File

@@ -204,3 +204,7 @@ if __name__ == '__main__':
# Bind to PORT if defined, otherwise default to 5000.
port = int(os.environ.get('PORT', 5000))
app.run(host='127.0.0.1', port=port)
@app.teardown_appcontext
def teardown_db(exception):
db.close_conn()