From b3c2c4f8d9ac16b6b44f2a390d255007a46d2d8f Mon Sep 17 00:00:00 2001 From: xxm Date: Fri, 21 Aug 2026 20:13:59 +0800 Subject: [PATCH] =?UTF-8?q?feat(price=5Fmonitor):=20=E6=8E=A5=E5=85=A5?= =?UTF-8?q?=E7=BB=9F=E4=B8=80messenger=E2=80=94=E2=80=94=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=8E=A8=E8=8D=90=E5=BD=92=E6=A1=A3broadcast+xmpp=E6=8E=A8?= =?UTF-8?q?=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/price_monitor.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/deploy/profile-scripts/price_monitor.py b/deploy/profile-scripts/price_monitor.py index 84dbe93c..46c118aa 100644 --- a/deploy/profile-scripts/price_monitor.py +++ b/deploy/profile-scripts/price_monitor.py @@ -10,6 +10,7 @@ from datetime import datetime from mo_data import read_decisions from alert_logger import record_alert, clear_alert +from messenger import send as messenger_send # ── 温区感知 + 信号溯源(2026-08-13)── try: @@ -179,6 +180,11 @@ def push_to_xmpp(text): # ACTION: 破止损/重评确认的操作信号 — 直通不限速 # INFO: 未确认的进区提示 — 聚合成摘要,30min 限 1 条 def _push_action(category, text): + # 统一消息处理者:操作推荐→broadcast归档+xmpp推送 + try: + messenger_send(title=f"MoFin持仓异动", content=text, source="price_monitor.py") + except Exception as e: + print(f"[messenger失败] {e}", file=sys.stderr) try: from alert_helper import notify, ACTION notify(category, text, ACTION) @@ -187,6 +193,11 @@ def _push_action(category, text): def _push_digest(category, text): + # 普通监控信息:broadcast 归档(不打扰 xmpp) + try: + messenger_send(title=f"MoFin价格监控", content=text, source="price_monitor.py") + except Exception as e: + print(f"[messenger归档失败] {e}", file=sys.stderr) try: from alert_helper import notify, INFO notify(category, text, INFO)