fix: address third code review findings

- Prevent infinite pagination loop when API returns empty release groups page
- Move NormalizeString regexes to package level to avoid recompilation on every call
- Use UTC consistently for cached_at timestamps to avoid DST-related TTL skew
This commit is contained in:
2026-05-26 16:24:55 +03:00
parent 582202bb86
commit 5d52a09868
3 changed files with 14 additions and 8 deletions

View File

@@ -55,7 +55,7 @@ func SyncArtistDiscography(
filtered := FilterReleaseGroups(groups)
// Step 5: Upsert within a transaction — delete old entries first, then insert new ones.
now := time.Now()
now := time.Now().UTC()
tx, err := db.Begin()
if err != nil {
return nil, fmt.Errorf("sync artist discography: begin transaction: %w", err)