ML-191: avoid VACUUM / scrobble refresh write collision

Set busy_timeout: 5_000 on MusicLibrary.Repo so SQLite waits up to
5 seconds on lock contention instead of throwing SQLITE_BUSY
immediately (default is 0).

Move RepoVacuum from 0 3 to 3 3 (3:03 AM London) to avoid the
deterministic collision with RefreshScrobbles which fires on the
every-5-min cadence at the hour mark.
This commit is contained in:
Claudio Ortolina
2026-05-19 16:45:19 +01:00
parent d8b0dd2327
commit 4a6c80f7a9
3 changed files with 65 additions and 2 deletions
+3 -2
View File
@@ -49,8 +49,9 @@ config :music_library, Oban,
{"0 */12 * * *", MusicLibrary.Worker.PruneAssetCache},
# every day at 2 am,
{"0 2 * * *", MusicLibrary.Worker.PruneAssets},
# every day at 3 am,
{"0 3 * * *", MusicLibrary.Worker.RepoVacuum},
# every day at 3:03 am (staggered 3 min past the hour to avoid
# collision with RefreshScrobbles every-5-min cadence, fixes #4075)
{"3 3 * * *", MusicLibrary.Worker.RepoVacuum},
# every day at 4 am,
{"0 4 * * *", MusicLibrary.Worker.RepoOptimize},
# every first day of the month, staggered hourly