Fix backend startup: add retry logic for DB init, proper logging, ensure all models imported before create_all, increase healthcheck start_period
This commit is contained in:
parent
00c58c6f62
commit
16d00fbd1b
3 changed files with 45 additions and 13 deletions
|
|
@ -25,5 +25,8 @@ async def get_db():
|
|||
|
||||
|
||||
async def init_db():
|
||||
# Import all models so their tables are registered on Base.metadata
|
||||
import app.models # noqa: F401
|
||||
|
||||
async with engine.begin() as conn:
|
||||
await conn.run_sync(Base.metadata.create_all)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue