mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-01-07 00:06:57 +01:00
Fixes (#14480)
* Catch case where object does not have thumbnail data * Catch intel stats json decoding error * Catch division by zero
This commit is contained in:
parent
8fcb8e54f7
commit
560dc68120
@ -344,6 +344,7 @@ class CameraState:
|
||||
# if the object's thumbnail is not from the current frame, skip
|
||||
if (
|
||||
current_frame is None
|
||||
or obj.thumbnail_data is None
|
||||
or obj.false_positive
|
||||
or obj.thumbnail_data["frame_time"] != frame_time
|
||||
):
|
||||
|
@ -279,7 +279,11 @@ def get_intel_gpu_stats() -> dict[str, str]:
|
||||
logger.error(f"Unable to poll intel GPU stats: {p.stderr}")
|
||||
return None
|
||||
else:
|
||||
data = json.loads(f'[{"".join(p.stdout.split())}]')
|
||||
try:
|
||||
data = json.loads(f'[{"".join(p.stdout.split())}]')
|
||||
except json.JSONDecodeError:
|
||||
return {"gpu": "-%", "mem": "-%"}
|
||||
|
||||
results: dict[str, str] = {}
|
||||
render = {"global": []}
|
||||
video = {"global": []}
|
||||
@ -328,7 +332,7 @@ def get_intel_gpu_stats() -> dict[str, str]:
|
||||
results["clients"] = {}
|
||||
|
||||
for key in render.keys():
|
||||
if key == "global":
|
||||
if key == "global" or not render[key] or not video[key]:
|
||||
continue
|
||||
|
||||
results["clients"][key] = (
|
||||
|
Loading…
Reference in New Issue
Block a user