mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-01-21 00:06:44 +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 the object's thumbnail is not from the current frame, skip
|
||||||
if (
|
if (
|
||||||
current_frame is None
|
current_frame is None
|
||||||
|
or obj.thumbnail_data is None
|
||||||
or obj.false_positive
|
or obj.false_positive
|
||||||
or obj.thumbnail_data["frame_time"] != frame_time
|
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}")
|
logger.error(f"Unable to poll intel GPU stats: {p.stderr}")
|
||||||
return None
|
return None
|
||||||
else:
|
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] = {}
|
results: dict[str, str] = {}
|
||||||
render = {"global": []}
|
render = {"global": []}
|
||||||
video = {"global": []}
|
video = {"global": []}
|
||||||
@ -328,7 +332,7 @@ def get_intel_gpu_stats() -> dict[str, str]:
|
|||||||
results["clients"] = {}
|
results["clients"] = {}
|
||||||
|
|
||||||
for key in render.keys():
|
for key in render.keys():
|
||||||
if key == "global":
|
if key == "global" or not render[key] or not video[key]:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
results["clients"][key] = (
|
results["clients"][key] = (
|
||||||
|
Loading…
Reference in New Issue
Block a user