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
+3 -3
View File
@@ -1,7 +1,7 @@
"""
查询单个设备详情 — GET /aibox/get_device?board_id=xxx
"""
import json
import orjson
import logging
from datetime import datetime
@@ -39,8 +39,8 @@ async def get_device(board_id: str, worker_id: str = "") -> dict:
ping_data = {}
try:
ping_data = json.loads(record.ping_data) if record.ping_data else {}
except json.JSONDecodeError:
ping_data = orjson.loads(record.ping_data.encode("utf-8")) if record.ping_data else {}
except orjson.JSONDecodeError:
pass
return {