Improve Storage Logs (#7338)

* Make storage maintenance messages more clear

* Log when storage maintenance is happening

* Formatting
This commit is contained in:
Nicolas Mowen 2023-08-01 05:26:45 -06:00 committed by GitHub
parent c2e2656407
commit 98576418a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,7 +153,7 @@ class StorageMaintainer(threading.Thread):
# 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())
@ -185,6 +185,9 @@ class StorageMaintainer(threading.Thread):
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...")