Limit to 1 row since that is all that is used

This commit is contained in:
Nick Mowen 2023-06-06 07:31:30 -06:00
parent 3e93015b8f
commit 29f9bd4570

View File

@ -180,7 +180,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 = Recordings.select().order_by(Recordings.start_time).get() oldest_recording = Recordings.select().order_by(Recordings.start_time).limit(1).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