后台初始化组件,gc全局化避免每次回收触发GIL锁,音频定时发送

This commit is contained in:
Sakura-RanChen
2025-11-28 16:12:19 +08:00
parent 228596dbe3
commit fb5c35e6c9
11 changed files with 503 additions and 197 deletions
@@ -18,7 +18,7 @@ from config.manage_api_client import report as manage_report
TAG = __name__
def report(conn, type, text, opus_data, report_time):
async def report(conn, type, text, opus_data, report_time):
"""执行聊天记录上报操作
Args:
@@ -33,8 +33,8 @@ def report(conn, type, text, opus_data, report_time):
audio_data = opus_to_wav(conn, opus_data)
else:
audio_data = None
# 执行上报
manage_report(
# 执行异步上报
await manage_report(
mac_address=conn.device_id,
session_id=conn.session_id,
chat_type=type,