From ea139b05b074e5993a00d3e31385cbc777a6e894 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=A5=E5=BE=AE?= Date: Fri, 10 Jul 2026 17:05:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=AF=8F=E6=97=A5=E6=B1=87=E6=80=BB?= =?UTF-8?q?=E5=8F=AA=E5=8F=91=E4=B8=80=E6=AC=A1(16:35)+=E5=8A=A0sent?= =?UTF-8?q?=E6=A0=87=E8=AE=B0=E9=98=B2=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/cron_to_xmpp.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/cron_to_xmpp.py b/scripts/cron_to_xmpp.py index e32acf1e..2365193b 100644 --- a/scripts/cron_to_xmpp.py +++ b/scripts/cron_to_xmpp.py @@ -335,17 +335,19 @@ def scan(): today = datetime.now().strftime("%Y-%m-%d") stats = load_silent_stats() if stats.get("date") != today: - stats = {"date": today, "silent": 0, "short": 0, "script": 0} + stats = {"date": today, "silent": 0, "short": 0, "script": 0, "sent": False} stats["silent"] += n_silent stats["short"] += n_short stats["script"] += n_script save_silent_stats(stats) - # 16:30~16:35 发送当日汇总(收盘后) + # 收盘后16:35发送一次当日汇总(不重复发) now = datetime.now() hhmm = now.hour * 60 + now.minute - if 990 <= hhmm <= 995: # 16:30~16:35 + if hhmm == 995 and not stats.get("sent"): # 16:35,仅一次 send_silent_summary(stats) + stats["sent"] = True + save_silent_stats(stats) log = f"推送{n_pushed}份,静默拦截{n_silent}份,过短{n_short}份,跳过脚本{n_script}份" print(log, file=sys.stderr)