Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
WSL0809 committed May 27, 2024
1 parent f715b2c commit 004605d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
room_router)
from fastapi.middleware.cors import CORSMiddleware

model.Base.metadata.create_all(bind=engine)
with engine.connect() as conn:
conn.execute("SELECT pg_advisory_lock(123456);")
model.Base.metadata.create_all(bind=engine)
conn.execute("SELECT pg_advisory_unlock(123456);")
SHOW_DOCS = os.getenv("SHOW_DOCS", "false").lower() == "true"
app = FastAPI(docs_url="/docs" if SHOW_DOCS else None)
app.include_router(change_room_router)
Expand Down

0 comments on commit 004605d

Please sign in to comment.