fix: 법령 저장 후 즉시 commit — 알림 실패가 DB 롤백하지 않도록

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-04-03 14:50:39 +09:00
parent 93c5805060
commit 1668be0a75

View File

@@ -173,8 +173,14 @@ async def _check_law(
revision_type, prev_date,
)
# CalDAV + SMTP 알림
_send_notifications(law_name, proclamation_date, revision_type)
# DB 먼저 커밋 (알림 실패가 저장을 막지 않도록)
await session.commit()
# CalDAV + SMTP 알림 (실패해도 무시)
try:
_send_notifications(law_name, proclamation_date, revision_type)
except Exception as e:
logger.warning(f"[{law_name}] 알림 발송 실패 (무시): {e}")
return count