fix-remove-all-message-truncation
This commit is contained in:
@@ -95,9 +95,7 @@ def notify(category, body, level=INFO):
|
||||
return False
|
||||
# 篇幅截断
|
||||
lines = body.splitlines()
|
||||
if len(lines) > INFO_MAX_LINES:
|
||||
body = "\n".join(lines[:INFO_MAX_LINES]) + \
|
||||
f"\n…(共{len(lines)}行,详见 gateway/logs/)"
|
||||
body = "\n".join(lines)
|
||||
# 告知压制历史
|
||||
if entry.get("suppressed", 0) > 0:
|
||||
body += f"\n(注: 上次以来另有 {entry['suppressed']} 条同类通知已按频率策略静默)"
|
||||
@@ -109,8 +107,7 @@ def notify(category, body, level=INFO):
|
||||
_log(f"[{category}] ACTION 内容重复(5min内),静默")
|
||||
return False
|
||||
lines = body.splitlines()
|
||||
if len(lines) > ACTION_MAX_LINES:
|
||||
body = "\n".join(lines[:ACTION_MAX_LINES]) + f"\n…(共{len(lines)}行)"
|
||||
body = "\n".join(lines)
|
||||
prefix = f"🚨【MoFin·{category}】"
|
||||
|
||||
# 写入 broadcast_messages(统一消息源,告警类)
|
||||
|
||||
@@ -131,7 +131,7 @@ def send_action_recommendation(title, content, source=None):
|
||||
class _MessengerStdout:
|
||||
# 2026-08-24 事件块聚合:逐行碎片→一块一条消息(老莫:broadcast每条消息详情=摘要,无信息量)
|
||||
# 块边界:静默>2秒 或 满25行;atexit强制flush。xmpp实时输出不缓冲(hermes靠stdout推送)。
|
||||
MAX_BLOCK_LINES = 25
|
||||
MAX_BLOCK_LINES = 100
|
||||
MAX_IDLE_SEC = 2.0
|
||||
|
||||
def __init__(self, orig, script):
|
||||
|
||||
Reference in New Issue
Block a user