From ff9fb9eb1b11e3cbf929909be00ba68c538e9742 Mon Sep 17 00:00:00 2001 From: hrz <1710360675@qq.com> Date: Mon, 28 Jul 2025 22:38:48 +0800 Subject: [PATCH] =?UTF-8?q?update:=E4=BC=98=E5=8C=96=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main/xiaozhi-server/core/connection.py | 1 - main/xiaozhi-server/core/handle/textHandle.py | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/main/xiaozhi-server/core/connection.py b/main/xiaozhi-server/core/connection.py index 7221281f..f9ab946d 100644 --- a/main/xiaozhi-server/core/connection.py +++ b/main/xiaozhi-server/core/connection.py @@ -279,7 +279,6 @@ class ConnectionHandler: async def _route_message(self, message): """消息路由""" if isinstance(message, str): - self.last_activity_time = time.time() * 1000 await handleTextMessage(self, message) elif isinstance(message, bytes): if self.vad is None: diff --git a/main/xiaozhi-server/core/handle/textHandle.py b/main/xiaozhi-server/core/handle/textHandle.py index cdb20ac5..1bcf4545 100644 --- a/main/xiaozhi-server/core/handle/textHandle.py +++ b/main/xiaozhi-server/core/handle/textHandle.py @@ -1,4 +1,5 @@ import json +import time from core.handle.abortHandle import handleAbortMessage from core.handle.helloHandle import handleHelloMessage from core.providers.tools.device_mcp import handle_mcp_message @@ -45,6 +46,7 @@ async def handleTextMessage(conn, message): conn.client_have_voice = False conn.asr_audio.clear() if "text" in msg_json: + conn.last_activity_time = time.time() * 1000 original_text = msg_json["text"] # 保留原始文本 filtered_len, filtered_text = remove_punctuation_and_length( original_text