mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 01:35:22 +03:00
Catch case where camera has 0 nonzero segment durations
This commit is contained in:
parent
3af9929e1d
commit
0d4118f590
@ -45,6 +45,7 @@ class StorageMaintainer(threading.Thread):
|
||||
}
|
||||
|
||||
# calculate MB/hr
|
||||
try:
|
||||
bandwidth = round(
|
||||
Recordings.select(fn.AVG(bandwidth_equation))
|
||||
.where(Recordings.camera == camera, Recordings.segment_size != 0)
|
||||
@ -53,6 +54,9 @@ class StorageMaintainer(threading.Thread):
|
||||
* 3600,
|
||||
2,
|
||||
)
|
||||
except TypeError:
|
||||
bandwidth = 0
|
||||
|
||||
self.camera_storage_stats[camera]["bandwidth"] = bandwidth
|
||||
logger.debug(f"{camera} has a bandwidth of {bandwidth} MB/hr.")
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user