forked from Github/frigate
DB Optimizations (#6712)
* Enable auto vacuums * Enable auto vacuum * Fix separator * Fix separator and remove incorrect log * Limit to 1 row since that is all that is used * Add index on camera + segment_size * Formatting * Increase timeout and cache_size * Set DB mode to NORMAL synchronous level * Formatting * Vacuum every 2 weeks * Remove fstring * Use string * Use consts
This commit is contained in:
@@ -180,7 +180,9 @@ class RecordingCleanup(threading.Thread):
|
||||
|
||||
# find all the recordings older than the oldest recording in the db
|
||||
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)
|
||||
oldest_timestamp = p.stat().st_mtime - 1
|
||||
|
||||
Reference in New Issue
Block a user