From 2f96e0a000685f7684535622269ebb974b3d408f Mon Sep 17 00:00:00 2001 From: mkelvers Date: Thu, 30 Apr 2026 08:14:48 +0200 Subject: [PATCH] fix: don't cache empty jikan responses --- integrations/jikan/client.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/integrations/jikan/client.go b/integrations/jikan/client.go index 4256a68..dfd8c3f 100644 --- a/integrations/jikan/client.go +++ b/integrations/jikan/client.go @@ -271,6 +271,12 @@ func (c *Client) getWithCache(ctx context.Context, cacheKey string, ttl time.Dur return err } + // Don't cache empty results to avoid caching failures + if isEmptyResult(out) { + log.Printf("jikan: fetched data for %s is empty, not caching", cacheKey) + return fmt.Errorf("jikan: empty response for %s", cacheKey) + } + c.setCache(ctx, cacheKey, out, ttl) return nil }