fix/scheduler-kst-timezone #15
Reference in New Issue
Block a user
Delete Branch "fix/scheduler-kst-timezone"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
AsyncIOScheduler(timezone="Asia/Seoul") 의 scheduler-level timezone 이 CronTrigger 에 자동 전파되지 않아 6 cron 모두 UTC 로 fire 되던 버그. 영향 (모두 9h 오차): - morning_briefing 의도 05:10 KST → 실제 14:10 KST - daily_digest 의도 20:00 KST → 실제 05:00 KST (다음날) - global_digest 의도 04:00 KST → 실제 13:00 KST - law_monitor 의도 07:00 KST → 실제 16:00 KST - mailplus_morning 의도 07:00 KST → 실제 16:00 KST - mailplus_evening 의도 18:00 KST → 실제 03:00 KST (다음날) Fix: 모든 CronTrigger 에 timezone=KST (= ZoneInfo("Asia/Seoul")) 명시. 검증 (재시작 후): law_monitor next: 2026-05-13 07:00 KST mailplus_morning next: 2026-05-13 07:00 KST mailplus_evening next: 2026-05-13 18:00 KST daily_digest next: 2026-05-13 20:00 KST global_digest next: 2026-05-14 04:00 KST morning_briefing next: 2026-05-14 05:10 KST매일 20:00 KST cron fire 시 fail: UndefinedFunctionError: operator does not exist: date = character varying 원인: today 가 strftime("%Y-%m-%d") 로 string, func.date(created_at) 가 date 타입. PostgreSQL 가 date = string 비교 거부. Fix: today = datetime.now(ZoneInfo("Asia/Seoul")).date() — date 객체로. KST 기준은 scheduler cron 이 KST 20:00 에 fire 되므로 자연 일치. scope: app/workers/daily_digest.py:24