Skip to content
Snippets Groups Projects
Commit 869af700 authored by Arie Peterson's avatar Arie Peterson
Browse files

Dispose of database connection after init

parent 6d9b552d
No related branches found
Tags 0.1.5
1 merge request!217Resolve "Weird database errors"
Pipeline #47795 passed with stages
in 4 minutes and 9 seconds
......@@ -178,6 +178,13 @@ else:
# cli.
flask_migrate.Migrate(app, db)
# Now that we've done all database interactions in the initialisation routines,
# we need to drop all connections to the database to prevent those from being
# shared among different worker processes.
logging.info("Disposing of database connections.")
with app.app_context():
db.engine.dispose()
app.register_blueprint(api_v1)
app.register_blueprint(web)
app.register_blueprint(cli)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment