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 }