From 2dbbeac1c7e6e75eef65d6c1f2231fbac695953c Mon Sep 17 00:00:00 2001 From: hyungi Date: Tue, 12 May 2026 21:30:41 +0000 Subject: [PATCH] fix(daily_digest): cast today to date object for KST comparison MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 매일 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 --- app/workers/daily_digest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/workers/daily_digest.py b/app/workers/daily_digest.py index 213a9be..edd31e0 100644 --- a/app/workers/daily_digest.py +++ b/app/workers/daily_digest.py @@ -6,6 +6,7 @@ DEVONthink/OmniFocus → PostgreSQL/CalDAV 쿼리로 전환. import os from datetime import datetime, timezone +from zoneinfo import ZoneInfo from pathlib import Path from sqlalchemy import func, select, text @@ -21,7 +22,8 @@ logger = setup_logger("daily_digest") async def run(): """일일 다이제스트 생성 + 저장 + 발송""" - today = datetime.now(timezone.utc).strftime("%Y-%m-%d") + # KST 기준 오늘 (cron 이 KST timezone fix 후 20:00 KST 에 fire). date 객체로 비교 — Document.created_at::date 와 직접 매칭. + today = datetime.now(ZoneInfo("Asia/Seoul")).date() sections = [] async with async_session() as session: