refactor(providers): one paced, retrying HTTP client for cover art and tags (#8002)
coverart/httpclient.go and tags/httpclient.go were the same client: pacing, exponential backoff with jitter, 401/403-as-transient, body caps. Tags had added a User-Agent and a shared Pacer, cover art an image GET. providers.HTTPClient now has all of it, with the tests that were in coverart. ErrTransient is shared too, so both families' errors.Is still match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2,7 +2,6 @@ package coverart
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"git.fabledsword.com/bvandeusen/minstrel/internal/apierror"
|
||||
"git.fabledsword.com/bvandeusen/minstrel/internal/providers"
|
||||
@@ -83,7 +82,7 @@ var ErrNotFound = apierror.ErrNotFound
|
||||
// ErrTransient indicates a temporary failure (5xx, network, timeout,
|
||||
// auth issue). The enricher leaves the row's source NULL so the next
|
||||
// scan pass can retry.
|
||||
var ErrTransient = errors.New("coverart: transient error")
|
||||
var ErrTransient = providers.ErrTransient
|
||||
|
||||
// registry is every compiled-in cover-art provider. The enricher iterates
|
||||
// it filtered by the current settings.
|
||||
|
||||
Reference in New Issue
Block a user