Various Bug Fixes (#6768)

* Fix birdseye infinite loop

* Fix division by zero
This commit is contained in:
Nicolas Mowen
2023-06-12 04:06:02 -06:00
committed by GitHub
parent dfd574beeb
commit ff90db30e6
2 changed files with 18 additions and 4 deletions

View File

@@ -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..."
)