diff --git a/docs/docs/configuration/reference.md b/docs/docs/configuration/reference.md index 2de72417c..858b6e935 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 37a2b4645..6a91c1aaf 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