mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 10:45:21 +03:00
Fix division by zero
This commit is contained in:
parent
4bb5313c78
commit
ad27b3c7be
@ -241,7 +241,7 @@ class RecordingCleanup(threading.Thread):
|
||||
{"id": recording_id} for recording_id in recordings_to_delete
|
||||
]
|
||||
|
||||
if len(recordings_to_delete) / recordings.count() > 0.5:
|
||||
if len(recordings_to_delete) / max(1, recordings.count()) > 0.5:
|
||||
logger.debug(
|
||||
f"Deleting {(len(recordings_to_delete) / recordings.count()):2f}% of recordings could be due to configuration error. Aborting..."
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user