Skip to content

Commit

Permalink
Cap storage bandwidth (#15473)
Browse files Browse the repository at this point in the history
  • Loading branch information
NickM-27 authored Dec 12, 2024
1 parent ed2e1f3 commit d302b6e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions frigate/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
Recordings.end_time - Recordings.start_time
)

MAX_CALCULATED_BANDWIDTH = 10000 # 10Gb/hr


class StorageMaintainer(threading.Thread):
"""Maintain frigates recording storage."""
Expand Down Expand Up @@ -52,6 +54,12 @@ def calculate_camera_bandwidth(self) -> None:
* 3600,
2,
)

if bandwidth > MAX_CALCULATED_BANDWIDTH:
logger.warning(
f"{camera} has a bandwidth of {bandwidth} MB/hr which exceeds the expected maximum. This typically indicates an issue with the cameras recordings."
)
bandwidth = MAX_CALCULATED_BANDWIDTH
except TypeError:
bandwidth = 0

Expand Down

0 comments on commit d302b6e

Please sign in to comment.