mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
fix old style recording cleanup
This commit is contained in:
parent
18f4ab2644
commit
cd87f3e6f4
@ -290,9 +290,7 @@ class RecordingCleanup(threading.Thread):
|
|||||||
|
|
||||||
# find all the recordings older than the oldest recording in the db
|
# find all the recordings older than the oldest recording in the db
|
||||||
try:
|
try:
|
||||||
oldest_recording = (
|
oldest_recording = Recordings.select().order_by(Recordings.start_time).get()
|
||||||
Recordings.select().order_by(Recordings.start_time.desc()).get()
|
|
||||||
)
|
|
||||||
|
|
||||||
p = Path(oldest_recording.path)
|
p = Path(oldest_recording.path)
|
||||||
oldest_timestamp = p.stat().st_mtime - 1
|
oldest_timestamp = p.stat().st_mtime - 1
|
||||||
@ -301,7 +299,7 @@ class RecordingCleanup(threading.Thread):
|
|||||||
|
|
||||||
logger.debug(f"Oldest recording in the db: {oldest_timestamp}")
|
logger.debug(f"Oldest recording in the db: {oldest_timestamp}")
|
||||||
process = sp.run(
|
process = sp.run(
|
||||||
["find", RECORD_DIR, "-type", "f", "-newermt", f"@{oldest_timestamp}"],
|
["find", RECORD_DIR, "-type", "f", "!", "-newermt", f"@{oldest_timestamp}"],
|
||||||
capture_output=True,
|
capture_output=True,
|
||||||
text=True,
|
text=True,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user