mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-24 19:09:47 +01:00
fix(artwork): request read-through must not reset the failure backoff
The provisional read-through and dangling re-enqueue used Enqueue, whose upsert resets retry_at, so any browse of an unresolved entity that was backing off after an external failure made it immediately eligible again — defeating the exponential backoff during a provider outage. Add EnqueueBump, which raises priority but leaves an existing row's retry_at intact, and route the serving path through it. Scan and manual re-resolve keep Enqueue's reset (a detected change wants immediate retry).
This commit is contained in:
parent
c2d7ae773c
commit
ca4220b029
5 changed files with 71 additions and 4 deletions
|
|
@ -91,8 +91,12 @@ type ArtworkRepository interface {
|
|||
}
|
||||
|
||||
type ArtworkQueueRepository interface {
|
||||
// Enqueue upserts; an existing row keeps the higher of the two priorities.
|
||||
// Enqueue upserts; an existing row keeps the higher of the two priorities and has its
|
||||
// retry_at reset (a detected change wants immediate re-resolution).
|
||||
Enqueue(items ...ArtworkQueueItem) error
|
||||
// EnqueueBump upserts like Enqueue but preserves an existing row's retry_at, so a
|
||||
// request-triggered read-through never resets a failed resolution's backoff.
|
||||
EnqueueBump(items ...ArtworkQueueItem) error
|
||||
// DequeueBatch returns up to n items with retry_at <= now, priority desc, enqueued_at asc.
|
||||
DequeueBatch(n int) ([]ArtworkQueueItem, error)
|
||||
// MarkFailed increments attempts and pushes retry_at into the future.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue