diff --git a/app/config.py b/app/config.py index 264791c..bc6acdd 100644 --- a/app/config.py +++ b/app/config.py @@ -41,7 +41,7 @@ class Settings(BaseSettings): # 애플리케이션 버전 # deploy브랜치로 병합할 때 - app_version: str = "1.2.4" + app_version: str = "1.2.5" @property def allowed_origins_list(self) -> list[str]: diff --git a/app/services/news/news_db_repository.py b/app/services/news/news_db_repository.py index a5b68b4..a08da34 100644 --- a/app/services/news/news_db_repository.py +++ b/app/services/news/news_db_repository.py @@ -34,16 +34,28 @@ async def save_column(self, column_data: Dict[str, Any]) -> bool: "sections": sections }, ensure_ascii=False) - # source_published_at을 TIMESTAMP로 변환 (문자열인 경우) + # source_published_at을 날짜만 추출 (YYYY-MM-DD 형식) published_at_timestamp = None if source_published_at: try: - # ISO 형식 문자열을 파싱 + # ISO 형식 문자열에서 날짜 부분만 추출 (YYYY-MM-DD) if isinstance(source_published_at, str): - published_at_timestamp = datetime.fromisoformat(source_published_at.replace('Z', '+00:00')) + # "2025-11-14T19:16:24Z" -> "2025-11-14" + date_str = source_published_at.split('T')[0] + # 날짜만 파싱하여 시간은 00:00:00으로 설정 + published_at_timestamp = datetime.strptime(date_str, '%Y-%m-%d') else: - published_at_timestamp = source_published_at - except Exception: + # datetime 객체인 경우 날짜만 추출 + if isinstance(source_published_at, datetime): + published_at_timestamp = datetime( + source_published_at.year, + source_published_at.month, + source_published_at.day + ) + else: + published_at_timestamp = None + except Exception as e: + logger.warning("source_published_at_parse_failed", error=str(e), value=source_published_at) published_at_timestamp = None # UPSERT 쿼리 (INSERT ... ON CONFLICT DO UPDATE)