Commit df480160 authored by JanB's avatar JanB

Handle race in database creation when running multiple WSGI instances

parent 24b2b0a1
......@@ -161,6 +161,10 @@ Session.configure(bind=engine)
session = Session()
if not os.path.exists(dbpath):
Base.metadata.create_all(engine)
create_default_config()
create_admin_user()
try:
Base.metadata.create_all(engine)
create_default_config()
create_admin_user()
except Exception:
pass
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment