Merge pull request #4974 from MichaelEischer/fix-cache-debug-log

cache: fix confusing debug log
This commit is contained in:
Michael Eischer 2024-08-03 21:12:32 +02:00 committed by GitHub
commit e622135e7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -162,7 +162,9 @@ func (b *Backend) Load(ctx context.Context, h backend.Handle, length int, offset
// try loading from cache without checking that the handle is actually cached
inCache, err := b.loadFromCache(h, length, offset, consumer)
if inCache {
if err != nil {
debug.Log("error loading %v from cache: %v", h, err)
}
// the caller must explicitly use cache.Forget() to remove the cache entry
return err
}