Fixed race-condition in db creation
This commit is contained in:
parent
62ea95cfe4
commit
9c189d1447
@ -46,9 +46,12 @@ app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
|
|||||||
db.init_app(app)
|
db.init_app(app)
|
||||||
storage.init_app(app)
|
storage.init_app(app)
|
||||||
|
|
||||||
with app.app_context():
|
|
||||||
|
@app.before_first_request
|
||||||
|
def create_db():
|
||||||
db.create_all()
|
db.create_all()
|
||||||
|
|
||||||
|
|
||||||
# register error handlers
|
# register error handlers
|
||||||
register_all_error_handlers(app)
|
register_all_error_handlers(app)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user