feat(backend): call db.init_db() before uvicorn starts
This commit is contained in:
@@ -27,6 +27,10 @@ def main() -> None:
|
|||||||
]
|
]
|
||||||
if reload:
|
if reload:
|
||||||
sys.argv.append("--reload")
|
sys.argv.append("--reload")
|
||||||
|
# Initialize the DB (engine, migrations, schema) before the app
|
||||||
|
# boots so the first request hits a populated database.
|
||||||
|
from cyclone import db
|
||||||
|
db.init_db()
|
||||||
import uvicorn
|
import uvicorn
|
||||||
|
|
||||||
uvicorn.main()
|
uvicorn.main()
|
||||||
|
|||||||
Reference in New Issue
Block a user