v1.4.3: 大模型token/次数统计 + 调用优先级自动切换(全败才报错) + 通知日志查看正文/增强分页/批量删除

This commit is contained in:
2026-08-31 12:55:09 +08:00
parent 3f6abe7ad6
commit 4bbb6150cc
7 changed files with 477 additions and 67 deletions
+4 -4
View File
@@ -103,7 +103,7 @@ def _send_error_digest(errors):
f"<p style='color:#374151;font-size:13px;'>新闻智能跟踪系统检测到以下异常,请及时处理:</p>{rows}",
)
send_email(subject, html)
db.add_log("error", subject, len(errors), [], status="ok", detail="系统错误邮件通知")
db.add_log("error", subject, len(errors), [], status="ok", detail="系统错误邮件通知", body=html)
def _try_send_pending():
@@ -228,7 +228,7 @@ def send_realtime(articles):
ids = [a["id"] for a in articles]
for aid in ids:
db.update_article(aid, notified=1)
db.add_log("realtime", subject, len(articles), ids, status="ok", detail="实时通知")
db.add_log("realtime", subject, len(articles), ids, status="ok", detail="实时通知", body=html)
return len(articles)
@@ -254,7 +254,7 @@ def send_daily_summary(articles, window_label):
)
send_email(subject, html)
ids = [a["id"] for a in articles if a["id"]]
db.add_log("summary", subject, len(articles), ids, status="ok", detail=f"汇总{len(top)}")
db.add_log("summary", subject, len(articles), ids, status="ok", detail=f"汇总{len(top)}", body=html)
for aid in ids:
art = db.get_article(aid)
if art and art.get("status") != "summarized":
@@ -280,5 +280,5 @@ def send_custom_summary(articles, window_label):
)
send_email(subject, html)
ids = [a["id"] for a in articles if a["id"]]
db.add_log("custom_summary", subject, len(articles), ids, status="ok", detail=f"汇总{len(top)}")
db.add_log("custom_summary", subject, len(articles), ids, status="ok", detail=f"汇总{len(top)}", body=html)
return len(top)