Skip to content

Commit

Permalink
Improve Storage Logs (#7338)
Browse files Browse the repository at this point in the history
* Make storage maintenance messages more clear

* Log when storage maintenance is happening

* Formatting
  • Loading branch information
NickM-27 authored Aug 1, 2023
1 parent c2e2656 commit 9857641
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frigate/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def reduce_storage_consumption(self) -> None:
# check if need to delete retained segments
if deleted_segments_size < hourly_bandwidth:
logger.error(
f"Could not clear {hourly_bandwidth} currently {deleted_segments_size}, retained recordings must be deleted."
f"Could not clear {hourly_bandwidth} MB, currently {deleted_segments_size} MB have been cleared. Retained recordings must be deleted."
)
recordings = Recordings.select().order_by(Recordings.start_time.asc())

Expand Down Expand Up @@ -185,6 +185,9 @@ def run(self):
logger.debug(f"Default camera bandwidths: {self.camera_storage_stats}.")

if self.check_storage_needs_cleanup():
logger.info(
"Less than 1 hour of recording space left, running storage maintenance..."
)
self.reduce_storage_consumption()

logger.info("Exiting storage maintainer...")

0 comments on commit 9857641

Please sign in to comment.