fix(study): 워커 단독 진입 시 StudyQuestion mapper 초기화 위해 StudyTopic defensive import
This commit is contained in:
@@ -30,6 +30,10 @@ from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from ai.client import AIClient
|
||||
from core.database import async_session
|
||||
from models.study_question import StudyQuestion
|
||||
# StudyQuestion.topic relationship 이 "StudyTopic" 문자열 ref 라서, 별도 process
|
||||
# 진입점(예: docker exec python -c) 에서 워커 단독 실행 시 mapper 초기화 실패 방지.
|
||||
# 운영 path(main lifespan)는 라우터 import 로 자동 등록되지만 defensive.
|
||||
from models.study_topic import StudyTopic # noqa: F401 # mapper 등록만 필요
|
||||
|
||||
logger = logging.getLogger("study_question_embed_worker")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user