From a34ac03de623b0f7a61ea1141010baf979de5630 Mon Sep 17 00:00:00 2001 From: sentriz Date: Sat, 28 Oct 2023 19:11:33 +0100 Subject: [PATCH] make sure updated_at is up to date in artistinfocache --- artistinfocache/artistinfocache.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/artistinfocache/artistinfocache.go b/artistinfocache/artistinfocache.go index 63bde0cd..3bb6b753 100644 --- a/artistinfocache/artistinfocache.go +++ b/artistinfocache/artistinfocache.go @@ -57,6 +57,9 @@ func (a *ArtistInfoCache) Lookup(ctx context.Context, artist *db.Artist) (*db.Ar if err := a.db.FirstOrCreate(&artistInfo, "id=?", artistInfo.ID).Error; err != nil { return nil, fmt.Errorf("first or create artist info: %w", err) } + if err := a.db.Save(&artistInfo).Error; err != nil { + return nil, fmt.Errorf("bump updated_at time: %w", err) + } info, err := a.lastfmClient.ArtistGetInfo(artist.Name) if err != nil {