优化 ai_auto_response 队列过期丢弃与超时策略
- 为 ai_auto_response 队列消息记录入队时刻,并增加消息过期丢弃机制 - 在出队前与发送前各检查一次消息是否过期,避免补发过时群聊回复 - 为 skip 日志补充 age 字段,便于观察排队老化情况 - 将 ai_auto_response 外层总超时收紧到 20 秒,并新增 message_expire_sec=12 配置 - 将 Dify auto_reply.group 请求超时收紧到 15 秒,并关闭重试以提升群聊时效性
This commit is contained in:
@@ -40,6 +40,9 @@ def build_log_summary(event: str, data: Dict[str, Any]) -> str:
|
||||
).strip()
|
||||
|
||||
if event == "skip":
|
||||
age_text = ""
|
||||
if data.get("age_sec") not in (None, ""):
|
||||
age_text = f" age={data.get('age_sec')}"
|
||||
return (
|
||||
f"[XIAONIU] SKIP room={room} user={sender} "
|
||||
f"reason={data.get('reason', '')} "
|
||||
@@ -48,6 +51,7 @@ def build_log_summary(event: str, data: Dict[str, Any]) -> str:
|
||||
f"topic={data.get('topic', '-') or '-'} "
|
||||
f"acc={data.get('acceptance_state', '-') or '-'} "
|
||||
f"solver={data.get('solver', '-') or '-'}"
|
||||
f"{age_text}"
|
||||
).strip()
|
||||
|
||||
if event == "context":
|
||||
|
||||
Reference in New Issue
Block a user