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_alarm?alarm_id=xxx
"""
import json
import orjson
import logging
from chongming_worker import rpc_method
@@ -34,8 +34,8 @@ async def get_alarm(alarm_id: str, worker_id: str = "") -> dict:
alarm_data = {}
try:
alarm_data = json.loads(record.alarm_data) if record.alarm_data else {}
except json.JSONDecodeError:
alarm_data = orjson.loads(record.alarm_data.encode("utf-8")) if record.alarm_data else {}
except orjson.JSONDecodeError:
pass
return {