Handle race in database creation when running multiple WSGI instances
This commit is contained in:
parent
24b2b0a1ce
commit
df480160da
|
@ -161,6 +161,10 @@ Session.configure(bind=engine)
|
||||||
session = Session()
|
session = Session()
|
||||||
|
|
||||||
if not os.path.exists(dbpath):
|
if not os.path.exists(dbpath):
|
||||||
|
try:
|
||||||
Base.metadata.create_all(engine)
|
Base.metadata.create_all(engine)
|
||||||
create_default_config()
|
create_default_config()
|
||||||
create_admin_user()
|
create_admin_user()
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user