Skip to content

NVR with realtime local object detection for IP cameras

Fix percentage in recording cleanup log (#19525)

Josh Hawkinsaddb4e6891d6
diff --git a/docs/docs/configuration/reference.md b/docs/docs/configuration/reference.md
index 2de72417cd..858b6e9352 100644
--- a/docs/docs/configuration/reference.md
+++ b/docs/docs/configuration/reference.md
@@ -438,7 +438,7 @@ record:
# Optional: Number of minutes to wait between cleanup runs (default: shown below)
# This can be used to reduce the frequency of deleting recording segments from disk if you want to minimize i/o
expire_interval: 60
- # Optional: Sync recordings with disk on startup and once a day (default: shown below).
+ # Optional: Two-way sync recordings database with disk on startup and once a day (default: shown below).
sync_recordings: False
# Optional: Retention settings for recording
retain:
diff --git a/frigate/record/util.py b/frigate/record/util.py
index 37a2b46457..6a91c1aaf0 100644
--- a/frigate/record/util.py
+++ b/frigate/record/util.py
@@ -66,7 +66,7 @@ def sync_recordings(limited: bool) -> None:
if float(len(recordings_to_delete)) / max(1, recordings.count()) > 0.5:
logger.warning(
- f"Deleting {(float(len(recordings_to_delete)) / recordings.count()):2f}% of recordings DB entries, could be due to configuration error. Aborting..."
+ f"Deleting {(len(recordings_to_delete) / max(1, recordings.count()) * 100):.2f}% of recordings DB entries, could be due to configuration error. Aborting..."
)
return False
@@ -106,7 +106,7 @@ def sync_recordings(limited: bool) -> None:
if float(len(files_to_delete)) / max(1, len(files_on_disk)) > 0.5:
logger.debug(
- f"Deleting {(float(len(files_to_delete)) / len(files_on_disk)):2f}% of recordings DB entries, could be due to configuration error. Aborting..."
+ f"Deleting {(len(files_to_delete) / max(1, len(files_on_disk)) * 100):.2f}% of recordings DB entries, could be due to configuration error. Aborting..."
)
return False