mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-23 07:02:48 +03:00
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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user