fix: suppress context canceled logs

This commit is contained in:
2026-05-12 16:17:41 +02:00
parent 36d77ad793
commit 1e28e2597c
5 changed files with 99 additions and 31 deletions

View File

@@ -272,7 +272,9 @@ func (c *Client) getWithCache(ctx context.Context, cacheKey string, ttl time.Dur
return nil
}
}
log.Printf("jikan: stale cache unmarshal failed or empty, falling back to error: %v", err)
if !errors.Is(err, context.Canceled) {
log.Printf("jikan: stale cache unmarshal failed or empty, falling back to error: %v", err)
}
}
return err
}