后台初始化组件,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
+3 -3
View File
@@ -4,7 +4,7 @@ import json
import websockets
from config.logger import setup_logging
from core.connection import ConnectionHandler
from config.config_loader import get_config_from_api
from config.config_loader import get_config_from_api_async
from core.auth import AuthManager, AuthenticationError
from core.utils.modules_initialize import initialize_modules
from core.utils.util import check_vad_update, check_asr_update
@@ -133,8 +133,8 @@ class WebSocketServer:
"""
try:
async with self.config_lock:
# 重新获取配置
new_config = get_config_from_api(self.config)
# 重新获取配置(使用异步版本)
new_config = await get_config_from_api_async(self.config)
if new_config is None:
self.logger.bind(tag=TAG).error("获取新配置失败")
return False