fix: address second code review findings

- Add context cancellation check between pagination pages in GetArtistReleaseGroups
  for responsive graceful shutdown during large discography fetches.
- Eliminate double DB query on cache hit by having GetCachedReleases return
  []ExternalRelease directly instead of just a count, avoiding a redundant
  second query in SyncArtistDiscography.
- Update cache_test.go to match new GetCachedReleases return type.
- Format main.go (pre-existing whitespace issue).
This commit is contained in:
2026-05-26 15:58:40 +03:00
parent 2baf586607
commit 582202bb86
5 changed files with 34 additions and 25 deletions

View File

@@ -16,9 +16,9 @@ import (
// App holds all application dependencies for clean shutdown and testability.
type App struct {
cfg *config.Config
db *database.DB
mbClient *musicbrainz.MusicBrainzClient
cfg *config.Config
db *database.DB
mbClient *musicbrainz.MusicBrainzClient
}
const defaultConfigPath = "config.yaml"