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,14 +45,18 @@ class StorageMaintainer(threading.Thread):
|
|||||||
}
|
}
|
||||||
|
|
||||||
# calculate MB/hr
|
# calculate MB/hr
|
||||||
bandwidth = round(
|
try:
|
||||||
Recordings.select(fn.AVG(bandwidth_equation))
|
bandwidth = round(
|
||||||
.where(Recordings.camera == camera, Recordings.segment_size != 0)
|
Recordings.select(fn.AVG(bandwidth_equation))
|
||||||
.limit(100)
|
.where(Recordings.camera == camera, Recordings.segment_size != 0)
|
||||||
.scalar()
|
.limit(100)
|
||||||
* 3600,
|
.scalar()
|
||||||
2,
|
* 3600,
|
||||||
)
|
2,
|
||||||
|
)
|
||||||
|
except TypeError:
|
||||||
|
bandwidth = 0
|
||||||
|
|
||||||
self.camera_storage_stats[camera]["bandwidth"] = bandwidth
|
self.camera_storage_stats[camera]["bandwidth"] = bandwidth
|
||||||
logger.debug(f"{camera} has a bandwidth of {bandwidth} MB/hr.")
|
logger.debug(f"{camera} has a bandwidth of {bandwidth} MB/hr.")
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user