Retention/pruning for schedule_log and ai_usage_log (#59) #72
No reviewers
Labels
No labels
area/ai
area/backend
area/frontend
area/infra
area/scheduler
area/wled
good-first-issue
priority/high
priority/low
priority/medium
type/bug
type/chore
type/ci-cd
type/docs
type/feature
type/qa
v1.0.0
v1.1.0
v1.2.0
v2.0.0
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/Iris-WLED!72
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/59-retention"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #59. Neither log was ever pruned (
audit_logstays unpruned per §7.3).services/retention.py:prune_schedule_log(db, retain_days),prune_ai_usage_log(db, retain_hours=48),run_log_retention(...).run_reschedule_daily_jobs) — daily cadence keepsai_usage_logreliably inside its 48h window (only a rolling 24h is queried forAI_DAILY_LIMIT); the weekly job would let it sit ~7 days.schedule_logretention is configurable:SCHEDULE_LOG_RETAIN_DAYS(default 365) viaconfig.py+ aRuntimeSettings.schedule_log_retain_daysfield (follows thebackup_retain_countpattern), with aPUT /settingsside effect that re-prunes immediately on change. Documented in the spec config reference + troubleshooting.test_retention.py(old/kept/boundary for both tables + end-to-end via the daily job).Verified:
ruff/format/mypyclean; 225 tests pass (only the known Windows-only backup file-lock errors remain, green on Linux CI).🤖 Generated with Claude Code