Start adding storage maintainer

This commit is contained in:
Nick Mowen 2022-09-25 08:55:37 -06:00
parent 476d011c55
commit 3186046d45
2 changed files with 7 additions and 5 deletions

View File

@ -283,13 +283,9 @@ class RecordingMaintainer(threading.Thread):
logger.debug( logger.debug(
f"Copied {file_path} in {datetime.datetime.now().timestamp()-start_frame} seconds." f"Copied {file_path} in {datetime.datetime.now().timestamp()-start_frame} seconds."
) )
try:
segment_size = float(os.stat(file_path)) / 1000
except OSError:
segment_size = -1
try: try:
segment_size = float(os.path.getsize(file_path)) / 1000 segment_size = float(os.path.getsize(file_path)) / 1000000
except OSError: except OSError:
segment_size = -1 segment_size = -1

View File

@ -0,0 +1,6 @@
"""Handle storage retention and usage."""
import threading
class StorageMaintainer(threading.Thread):
"""Maintain frigates recording storage."""