Compare commits

...

2 Commits

Author SHA1 Message Date
Josh Hawkins
01c16a9250
check for config update before state evaluation (#22495)
Some checks failed
CI / AMD64 Build (push) Has been cancelled
CI / ARM Build (push) Has been cancelled
CI / Jetson Jetpack 6 (push) Has been cancelled
CI / AMD64 Extra Build (push) Has been cancelled
CI / ARM Extra Build (push) Has been cancelled
CI / Synaptics Build (push) Has been cancelled
CI / Assemble and push default build (push) Has been cancelled
2026-03-16 17:23:36 -05:00
Josh Hawkins
d4731c1dea
don't try to run cleanup if frigate is in safe mode (#22492) 2026-03-16 13:38:24 -06:00
4 changed files with 15 additions and 3 deletions

View File

@ -321,6 +321,9 @@ class AudioEventMaintainer(threading.Thread):
self.start_or_restart_ffmpeg() self.start_or_restart_ffmpeg()
while not self.stop_event.is_set(): while not self.stop_event.is_set():
# check if there is an updated config
self.config_subscriber.check_for_updates()
enabled = self.camera_config.enabled enabled = self.camera_config.enabled
if enabled != self.was_enabled: if enabled != self.was_enabled:
if enabled: if enabled:
@ -347,9 +350,6 @@ class AudioEventMaintainer(threading.Thread):
time.sleep(0.1) time.sleep(0.1)
continue continue
# check if there is an updated config
self.config_subscriber.check_for_updates()
self.read_audio() self.read_audio()
if self.audio_listener: if self.audio_listener:

View File

@ -324,6 +324,10 @@ class EventCleanup(threading.Thread):
return events_to_update return events_to_update
def run(self) -> None: def run(self) -> None:
if self.config.safe_mode:
logger.info("Safe mode enabled, skipping event cleanup")
return
# only expire events every 5 minutes # only expire events every 5 minutes
while not self.stop_event.wait(300): while not self.stop_event.wait(300):
events_with_expired_clips = self.expire_clips() events_with_expired_clips = self.expire_clips()

View File

@ -350,6 +350,10 @@ class RecordingCleanup(threading.Thread):
logger.debug("End expire recordings.") logger.debug("End expire recordings.")
def run(self) -> None: 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 # on startup sync recordings with disk if enabled
if self.config.record.sync_recordings: if self.config.record.sync_recordings:
sync_recordings(limited=False) sync_recordings(limited=False)

View File

@ -272,6 +272,10 @@ class StorageMaintainer(threading.Thread):
def run(self): def run(self):
"""Check every 5 minutes if storage needs to be cleaned up.""" """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() self.calculate_camera_bandwidth()
while not self.stop_event.wait(300): while not self.stop_event.wait(300):
if not self.camera_storage_stats or True in [ if not self.camera_storage_stats or True in [