refactor(main): rely on lifespan for db init (SP5)
This commit is contained in:
@@ -27,10 +27,8 @@ def main() -> None:
|
||||
]
|
||||
if 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()
|
||||
# DB + EventBus are initialized by the FastAPI lifespan handler
|
||||
# (cyclone.api:lifespan); no explicit pre-init is needed here.
|
||||
import uvicorn
|
||||
|
||||
uvicorn.main()
|
||||
|
||||
Reference in New Issue
Block a user