Fix lint errors

This commit is contained in:
Deluan 2021-02-08 10:36:07 -05:00 committed by Deluan Quintão
parent 877cdf1d5c
commit 365dff6435
3 changed files with 6 additions and 8 deletions

View File

@ -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))
})

View File

@ -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) {

View File

@ -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{}