From 835792e7b91fba79c0c9b1592845b81022e01d80 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Mon, 16 Mar 2026 13:56:38 -0500 Subject: [PATCH] don't try to run cleanup if frigate is in safe mode --- frigate/events/cleanup.py | 4 ++++ frigate/record/cleanup.py | 4 ++++ frigate/storage.py | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/frigate/events/cleanup.py b/frigate/events/cleanup.py index 1ac03b2ed..d13a96dcf 100644 --- a/frigate/events/cleanup.py +++ b/frigate/events/cleanup.py @@ -324,6 +324,10 @@ class EventCleanup(threading.Thread): return events_to_update def run(self) -> None: + if self.config.safe_mode: + logger.info("Safe mode enabled, skipping event cleanup") + return + # only expire events every 5 minutes while not self.stop_event.wait(300): events_with_expired_clips = self.expire_clips() diff --git a/frigate/record/cleanup.py b/frigate/record/cleanup.py index 94dd43eba..0e401e8ff 100644 --- a/frigate/record/cleanup.py +++ b/frigate/record/cleanup.py @@ -350,6 +350,10 @@ class RecordingCleanup(threading.Thread): logger.debug("End expire recordings.") def run(self) -> None: + if self.config.safe_mode: + logger.info("Safe mode enabled, skipping recording cleanup") + return + # on startup sync recordings with disk if enabled if self.config.record.sync_recordings: sync_recordings(limited=False) diff --git a/frigate/storage.py b/frigate/storage.py index feabe06ff..1234ef088 100644 --- a/frigate/storage.py +++ b/frigate/storage.py @@ -272,6 +272,10 @@ class StorageMaintainer(threading.Thread): def run(self): """Check every 5 minutes if storage needs to be cleaned up.""" + if self.config.safe_mode: + logger.info("Safe mode enabled, skipping storage maintenance") + return + self.calculate_camera_bandwidth() while not self.stop_event.wait(300): if not self.camera_storage_stats or True in [