refactor(main): rely on lifespan for db init (SP5)
This commit is contained in:
@@ -27,10 +27,8 @@ def main() -> None:
|
|||||||
]
|
]
|
||||||
if reload:
|
if reload:
|
||||||
sys.argv.append("--reload")
|
sys.argv.append("--reload")
|
||||||
# Initialize the DB (engine, migrations, schema) before the app
|
# DB + EventBus are initialized by the FastAPI lifespan handler
|
||||||
# boots so the first request hits a populated database.
|
# (cyclone.api:lifespan); no explicit pre-init is needed here.
|
||||||
from cyclone import db
|
|
||||||
db.init_db()
|
|
||||||
import uvicorn
|
import uvicorn
|
||||||
|
|
||||||
uvicorn.main()
|
uvicorn.main()
|
||||||
|
|||||||
Reference in New Issue
Block a user