Merge pull request #1936 from xinnan-tech/hot-fix

update:优化最后活动时间
This commit is contained in:
欣南科技 2025-07-28 22:40:21 +08:00 committed by GitHub
commit 121f1c4698
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -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:

View file

@ -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