From 365dff6435868328a2f0a2b2e4b625e1c7da23d4 Mon Sep 17 00:00:00 2001 From: Deluan Date: Mon, 8 Feb 2021 10:36:07 -0500 Subject: [PATCH] Fix lint errors --- core/agents/cached_http_client_test.go | 2 +- core/agents/lastfm.go | 1 - core/external_info2.go | 11 +++++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/core/agents/cached_http_client_test.go b/core/agents/cached_http_client_test.go index 7b484896d..36fb56b95 100644 --- a/core/agents/cached_http_client_test.go +++ b/core/agents/cached_http_client_test.go @@ -67,7 +67,7 @@ var _ = Describe("CachedHttpClient", func() { body, err = ioutil.ReadAll(resp.Body) Expect(err).To(BeNil()) Expect(string(body)).To(Equal("Hello, []")) - Expect(string(header)).To(Equal("this is a header")) + Expect(header).To(Equal("this is a header")) Expect(requestsReceived).To(Equal(3)) }) diff --git a/core/agents/lastfm.go b/core/agents/lastfm.go index da3980fe6..1a0c25e94 100644 --- a/core/agents/lastfm.go +++ b/core/agents/lastfm.go @@ -56,7 +56,6 @@ func (l *lastfmAgent) GetURL(name, mbid string) (string, error) { return "", ErrNotFound } return a.URL, nil - } func (l *lastfmAgent) GetBiography(name, mbid string) (string, error) { diff --git a/core/external_info2.go b/core/external_info2.go index d83574ba1..fea2b3524 100644 --- a/core/external_info2.go +++ b/core/external_info2.go @@ -65,13 +65,12 @@ func (e *externalInfo2) UpdateArtistInfo(ctx context.Context, id string, similar return nil, err } - // TODO Uncomment // If we have fresh info, just return it - //if time.Since(artist.ExternalInfoUpdatedAt) < consts.ArtistInfoTimeToLive { - // log.Debug("Found cached ArtistInfo", "updatedAt", artist.ExternalInfoUpdatedAt, "name", artist.Name) - // err := e.loadSimilar(ctx, artist, includeNotPresent) - // return artist, err - //} + if time.Since(artist.ExternalInfoUpdatedAt) < time.Second { //consts.ArtistInfoTimeToLive { + log.Debug("Found cached ArtistInfo", "updatedAt", artist.ExternalInfoUpdatedAt, "name", artist.Name) + err := e.loadSimilar(ctx, artist, includeNotPresent) + return artist, err + } log.Debug(ctx, "ArtistInfo not cached", "updatedAt", artist.ExternalInfoUpdatedAt, "id", id, "name", artist.Name) wg := &sync.WaitGroup{}