mirror of
https://github.com/rommapp/romm.git
synced 2026-11-28 17:48:31 +01:00
Orphaned covers and screenshots left behind by deleted ROMs accumulate indefinitely, because the only way to reclaim them is to trigger the cleanup task by hand. On a long-lived instance the resources directory grows without bound, which is a problem when it shares a filesystem with the database. Move the task to `tasks/scheduled/` and turn it into a `PeriodicTask` with an opt-in cron schedule, defaulting to 5:00 AM so it runs after the nightly scan and metadata tasks have settled. `enabled` stays `True` rather than tracking the new env var, because the run-task endpoint requires both `enabled` and `manual_run`. Gating it would have silently removed the ability to run the cleanup by hand, which is how it works today. The cron string is what is opt-in, and `init()` unschedules when it is unset. Add the new flag to the init script's scheduler condition, so enabling only this schedule still starts `rqscheduler`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>