From 200e541c6ebbda72a63c5e8868c22ff22b136906 Mon Sep 17 00:00:00 2001 From: zk Date: Tue, 2 Jun 2026 19:27:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=B8=E5=90=8Chash=20=E6=9B=B4=E6=96=B0=20s?= =?UTF-8?q?ource=5Furl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/main.py | 2 ++ app/services/job_clean_service.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index c4382b2..7653174 100644 --- a/app/main.py +++ b/app/main.py @@ -1,6 +1,7 @@ """项目入口:初始化数据源、加载字典、启动调度器""" import asyncio +import logging import signal import warnings from datetime import datetime @@ -9,6 +10,7 @@ from app.core.logger import log # 屏蔽 asyncmy INSERT IGNORE 产生的 Duplicate entry warnings warnings.filterwarnings("ignore", message=".*Duplicate entry.*") +logging.getLogger("asyncmy").setLevel(logging.ERROR) from app.core.database import init_db, close_db from app.services.dict_cache_service import dict_cache from app.scheduler.tasks import create_scheduler diff --git a/app/services/job_clean_service.py b/app/services/job_clean_service.py index db6b95d..62d7822 100644 --- a/app/services/job_clean_service.py +++ b/app/services/job_clean_service.py @@ -98,8 +98,8 @@ async def _do_clean(data: dict) -> None: if existing_id: now = datetime.now() await mysql.execute( - text("UPDATE bg_job SET status = 0, create_time = :now, update_time = :now WHERE id = :id"), - {"now": now, "id": existing_id}, + text("UPDATE bg_job SET status = 0, source_url = :url, create_time = :now, update_time = :now WHERE id = :id"), + {"url": data.get("detail_url"), "now": now, "id": existing_id}, ) await mysql.commit() await _update_pg_status(data_id, "cleaned")