mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-26 20:09:47 +01:00
fix(artwork): restart the retry budget on re-enqueue
The conflict clause updated only priority and retry_at, so a row that already existed kept its original attempts and enqueued_at. The worker measures the 12h give-up budget from enqueued_at, so any row that had been pending across a longer gap — a server left off, an upgrade, a laptop asleep — gave up on its very first attempt and settled absent. The manual re-resolve endpoint is the sharpest case: it clears artwork state and re-queues, but inherited the old row's spent window, so a deliberate retry got one shot. A fresh request now gets a fresh budget, with the mock updated to match.
This commit is contained in:
parent
2207211997
commit
2ee2b2d66f
3 changed files with 26 additions and 2 deletions
|
|
@ -40,6 +40,8 @@ func (m *MockArtworkQueueRepo) Enqueue(items ...model.ArtworkQueueItem) error {
|
|||
if prev, ok := m.Data[k]; ok {
|
||||
prev.Priority = max(prev.Priority, it.Priority)
|
||||
prev.RetryAt = now
|
||||
prev.Attempts = 0
|
||||
prev.EnqueuedAt = now
|
||||
m.Data[k] = prev
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue