From 3186046d455e8924472b4c7325d8f810e0d2cd55 Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Sun, 25 Sep 2022 08:55:37 -0600 Subject: [PATCH] Start adding storage maintainer --- frigate/record.py | 6 +----- frigate/storage.py | 6 ++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/frigate/record.py b/frigate/record.py index 18dedbbaa..23eb77ca6 100644 --- a/frigate/record.py +++ b/frigate/record.py @@ -283,13 +283,9 @@ class RecordingMaintainer(threading.Thread): logger.debug( 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: - segment_size = float(os.path.getsize(file_path)) / 1000 + segment_size = float(os.path.getsize(file_path)) / 1000000 except OSError: segment_size = -1 diff --git a/frigate/storage.py b/frigate/storage.py index e69de29bb..0a2d96aca 100644 --- a/frigate/storage.py +++ b/frigate/storage.py @@ -0,0 +1,6 @@ +"""Handle storage retention and usage.""" + +import threading + +class StorageMaintainer(threading.Thread): + """Maintain frigates recording storage.""" \ No newline at end of file