diff --git a/app/workers/law_monitor.py b/app/workers/law_monitor.py index 3b75cb5..b9ec8f1 100644 --- a/app/workers/law_monitor.py +++ b/app/workers/law_monitor.py @@ -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