From 4cf8d2b191f085ff65a51a825bb8be7e744bcb32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=A5=E5=BE=AE?= Date: Thu, 9 Jul 2026 10:35:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20xiaoguo=5Fsignal=5Fconsumer=E4=BF=A1?= =?UTF-8?q?=E5=8F=B7=E5=A0=86=E7=A7=AF=E9=97=AE=E9=A2=98=20=E2=80=94=20?= =?UTF-8?q?=E4=BD=BF=E7=94=A8SIGNAL=5FMAX=5FAGE=5FHOURS=E5=8F=96=E4=BB=A3d?= =?UTF-8?q?ate(today)=E8=BF=87=E6=BB=A4=EF=BC=8C=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E8=87=AA=E5=8A=A8=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 根因: xiaoguo_signal_consumer仅处理今日信号(date(created_at)=today), 旧信号永远不被消费→33条堆积。SIGNAL_MAX_AGE_HOURS=4定义后未使用。 修复: 1. consumer: date(today) → created_at > -4h 年龄过滤 2. consumer: 无时效内信号时自动标记过期信号为已处理 3. consumer: 移除mo_data.get_price导入(import path冲突),改用腾讯API直连 fallback 4. intraday_health_check: 信号堆积检查也限定4h内,避免过期信号误报 5. system_audit: 同 --- scripts/xiaoguo_signal_consumer.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scripts/xiaoguo_signal_consumer.py b/scripts/xiaoguo_signal_consumer.py index e4961625..6d71c7d3 100644 --- a/scripts/xiaoguo_signal_consumer.py +++ b/scripts/xiaoguo_signal_consumer.py @@ -45,7 +45,6 @@ def fetch_quote(code): # Fallback: 腾讯实时行情 API try: url = f"http://qt.gtimg.cn/q={code}" - import urllib.request resp = urllib.request.urlopen(url, timeout=10).read().decode("gbk") parts = resp.split("~") if len(parts) > 32: