From 1668be0a750a5b1b7dcb81ce5206b36a498708fb Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Fri, 3 Apr 2026 14:50:39 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=B2=95=EB=A0=B9=20=EC=A0=80=EC=9E=A5?= =?UTF-8?q?=20=ED=9B=84=20=EC=A6=89=EC=8B=9C=20commit=20=E2=80=94=20?= =?UTF-8?q?=EC=95=8C=EB=A6=BC=20=EC=8B=A4=ED=8C=A8=EA=B0=80=20DB=20?= =?UTF-8?q?=EB=A1=A4=EB=B0=B1=ED=95=98=EC=A7=80=20=EC=95=8A=EB=8F=84?= =?UTF-8?q?=EB=A1=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- app/workers/law_monitor.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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