diff --git a/backend/database.py b/backend/database.py index 5e644ca..39f07f6 100644 --- a/backend/database.py +++ b/backend/database.py @@ -80,7 +80,4 @@ async def init_db(): if attempt < 4: await asyncio.sleep(wait) - import logging - logging.getLogger(__name__).error( - f"DB 초기화 최종 실패 — 앱은 계속 기동, 요청 시 재연결 시도: {last_err}" - ) + raise RuntimeError(f"DB 초기화 최종 실패: {last_err}") from last_err diff --git a/backend/main.py b/backend/main.py index 0d2dcdc..6c64cfd 100644 --- a/backend/main.py +++ b/backend/main.py @@ -19,8 +19,7 @@ @asynccontextmanager async def lifespan(app: FastAPI): - import asyncio - asyncio.create_task(init_db()) # 백그라운드 실행 — 헬스체크 블로킹 방지 + await init_db() yield