mirror of
https://github.com/navidrome/navidrome.git
synced 2025-06-01 08:01:15 +03:00
Reduce noise in logs when pre-caching artwork
This commit is contained in:
parent
eaa7f7c7e9
commit
e1ba152a38
@ -121,7 +121,7 @@ func (a *cacheWarmer) processBatch(ctx context.Context, batch []model.ArtworkID)
|
|||||||
input := pl.FromSlice(ctx, batch)
|
input := pl.FromSlice(ctx, batch)
|
||||||
errs := pl.Sink(ctx, 2, input, a.doCacheImage)
|
errs := pl.Sink(ctx, 2, input, a.doCacheImage)
|
||||||
for err := range errs {
|
for err := range errs {
|
||||||
log.Warn(ctx, "Error warming cache", err)
|
log.Debug(ctx, "Error warming cache", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ func (a *cacheWarmer) doCacheImage(ctx context.Context, id model.ArtworkID) erro
|
|||||||
|
|
||||||
r, _, err := a.artwork.Get(ctx, id, consts.UICoverArtSize, false)
|
r, _, err := a.artwork.Get(ctx, id, consts.UICoverArtSize, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error caching id='%s': %w", id, err)
|
return fmt.Errorf("caching id='%s': %w", id, err)
|
||||||
}
|
}
|
||||||
defer r.Close()
|
defer r.Close()
|
||||||
_, err = io.Copy(io.Discard, r)
|
_, err = io.Copy(io.Discard, r)
|
||||||
|
@ -37,7 +37,7 @@ func selectImageReader(ctx context.Context, artID model.ArtworkID, extractFuncs
|
|||||||
}
|
}
|
||||||
log.Trace(ctx, "Failed trying to extract artwork", "artID", artID, "source", f, "elapsed", time.Since(start), err)
|
log.Trace(ctx, "Failed trying to extract artwork", "artID", artID, "source", f, "elapsed", time.Since(start), err)
|
||||||
}
|
}
|
||||||
return nil, "", fmt.Errorf("could not get a cover art for %s: %w", artID, ErrUnavailable)
|
return nil, "", fmt.Errorf("could not get `%s` cover art for %s: %w", artID.Kind, artID, ErrUnavailable)
|
||||||
}
|
}
|
||||||
|
|
||||||
type sourceFunc func() (r io.ReadCloser, path string, err error)
|
type sourceFunc func() (r io.ReadCloser, path string, err error)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user