keep recording cleanup running after a failed pass

An exception anywhere in a cleanup pass, such as an OSError from a read-only or unmounted storage path, ended the recording cleanup thread with nothing logged. Retention stopped until restart, and recordings, previews and database rows kept growing. Each pass now logs the exception and the loop continues.
This commit is contained in:
Josh Hawkins
2026-10-22 15:15:43 -05:00
parent 4d20a15283
commit 8fa8761a44
+9 -6
View File
@@ -516,10 +516,13 @@ class RecordingCleanup(threading.Thread):
logger.info("Exiting recording cleanup...")
break
self.clean_tmp_previews()
try:
self.clean_tmp_previews()
if counter == 0:
self.clean_tmp_clips()
maybe_empty_dirs = self.expire_recordings()
remove_empty_directories(Path(RECORD_DIR), maybe_empty_dirs)
self.truncate_wal()
if counter == 0:
self.clean_tmp_clips()
maybe_empty_dirs = self.expire_recordings()
remove_empty_directories(Path(RECORD_DIR), maybe_empty_dirs)
self.truncate_wal()
except Exception:
logger.exception("Recording cleanup pass failed")