Repository navigation
feat(db): run FTS optimize nightly instead of every 6h
OPTIMIZE INDEX takes ~10 minutes on a 17GB audit database and slows reads while it runs. Schedule it once per day at a configurable local time (DB_FTS_OPTIMIZE_AT, default 04:00) and keep DB_FTS_OPTIMIZE_INTERVAL_SEC as an explicit legacy override.
Ultraworked with Sisyphus
Co-authored-by: Sisyphus clio-agent@sisyphuslabs.ai