Improve recording retention logic (#20506)
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
CI / Assemble and push default build (push) Blocked by required conditions
CI / AMD64 Build (push) Waiting to run

* Change default event retention

* Update docs

* Handle both record and event record

* Catch edge case

* Undo motion change and improve motion behavior

* fix typo

* Remove record retention banner

* Remove unused

* Fix tests
This commit is contained in:
Nicolas Mowen
2025-10-15 11:09:28 -06:00
committed by GitHub
parent 3c8ef0c71c
commit e592c7044b
7 changed files with 95 additions and 118 deletions
+5 -1
View File
@@ -180,7 +180,11 @@ class RecordingCleanup(threading.Thread):
# Delete recordings outside of the retention window or based on the retention mode
if (
not keep
or (mode == RetainModeEnum.motion and recording.motion == 0)
or (
mode == RetainModeEnum.motion
and recording.motion == 0
and recording.objects == 0
)
or (mode == RetainModeEnum.active_objects and recording.objects == 0)
):
Path(recording.path).unlink(missing_ok=True)