Re-index the catalog periodically, not just at startup #2

Merged
gthelding merged 0 commits from fix/periodic-catalog-rebuild into main 2026-07-20 00:09:58 +00:00
gthelding commented 2026-07-19 16:05:06 +00:00 (Migrated from codeberg.org)

The 24h catalog staleness check only ran once in the FastAPI lifespan, so a container that stayed up never re-indexed newly added music without a manual /api/catalog/rebuild or a restart. Replace the one-shot build with an hourly maintenance loop — build() already no-ops unless the rebuild interval has passed, so the loop is cheap. This also covers finishing first-run setup after startup: the next tick builds the catalog instead of waiting for a restart.

The 24h catalog staleness check only ran once in the FastAPI lifespan, so a container that stayed up never re-indexed newly added music without a manual /api/catalog/rebuild or a restart. Replace the one-shot build with an hourly maintenance loop — build() already no-ops unless the rebuild interval has passed, so the loop is cheap. This also covers finishing first-run setup after startup: the next tick builds the catalog instead of waiting for a restart.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
thelinuxcast/dj!2
No description provided.