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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user