mirror of
https://github.com/partitioncloud/partitioncloud-server.git
synced 2025-01-23 09:16:25 +01:00
Automatically close db connexion
This commit is contained in:
parent
566caac0a5
commit
c735b1e496
@ -82,5 +82,13 @@ def add_user():
|
||||
return render_template("auth/register.html", albums=get_all_albums(), user=current_user)
|
||||
|
||||
|
||||
# Automatically close db after each request
|
||||
@app.after_request
|
||||
def after_request(response):
|
||||
if ('db' in g) and (g.db is not None):
|
||||
g.db.close()
|
||||
return response
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(host="0.0.0.0")
|
||||
|
Loading…
Reference in New Issue
Block a user