From 4266dca1b627776ad5a1540f9a7643a5ff722b65 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sat, 3 Aug 2024 18:51:38 +0200 Subject: [PATCH] cache: fix confusing debug log --- internal/backend/cache/backend.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/backend/cache/backend.go b/internal/backend/cache/backend.go index 63bb6f85f..94f648cf4 100644 --- a/internal/backend/cache/backend.go +++ b/internal/backend/cache/backend.go @@ -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 { - debug.Log("error loading %v from cache: %v", h, err) + 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 }