modify: 性能优化

This commit is contained in:
2026-08-23 04:34:38 +08:00
parent 51aa93eefb
commit 5ab68d6002
8 changed files with 19 additions and 20 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ AI Box Sophon Adapter — MQTT 心跳上报处理器
监听 MQTT 主题 /board_ping(通过 MQTT Bridge 路由到 chongming/aibox_sophon_adapter/board_ping),
解析设备心跳数据并更新数据库记录。
"""
import json
import orjson
import logging
from datetime import datetime
@@ -89,7 +89,7 @@ async def board_ping(request: BoardPingRequest, worker_id: str = "") -> dict:
return {"error": str(e)}
# ---- 以下为可选能力:失败只告警,不阻断心跳 ----
ping_data = json.loads(ping_json)
ping_data = orjson.loads(ping_json.encode("utf-8"))
# RTSP 拉流(依赖 ffmpeg;缺失时跳过并在启动日志提示)
medias = ping_data.get("Medias", {})