Fixed race-condition in db creation

This commit is contained in:
Pünkösd Marcell 2020-10-01 20:20:55 +02:00
parent 62ea95cfe4
commit 9c189d1447
1 changed files with 4 additions and 1 deletions

View File

@ -46,9 +46,12 @@ app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db.init_app(app)
storage.init_app(app)
with app.app_context():
@app.before_first_request
def create_db():
db.create_all()
# register error handlers
register_all_error_handlers(app)