feat: get plan bulk with cache#10
Open
tomerqodo wants to merge 4 commits intoaugment_full_base_feat_get_plan_bulk_with_cache_pr10from
Open
feat: get plan bulk with cache#10tomerqodo wants to merge 4 commits intoaugment_full_base_feat_get_plan_bulk_with_cache_pr10from
tomerqodo wants to merge 4 commits intoaugment_full_base_feat_get_plan_bulk_with_cache_pr10from
Conversation
🤖 Augment PR SummarySummary: Adds a Redis-backed cache layer for bulk subscription plan retrieval to reduce load on the billing API. Changes:
Technical Notes: Cache entries are stored as JSON blobs in Redis and validated via Pydantic 🤖 Was this summary useful? React with 👍 or 👎 |
| plan: str | ||
| expiration_date: int | ||
|
|
||
| def __str__(self) -> str: |
| logger.exception( | ||
| "get_plan_bulk: failed to validate subscription plan for tenant(%s)", tenant_id | ||
| ) | ||
| results[tenant_id] = None |
| plans_to_cache: dict[str, SubscriptionPlan] = {} | ||
|
|
||
| for tenant_id, subscription_plan in bulk_plans.items(): | ||
| tenant_plans[tenant_id] = subscription_plan |
There was a problem hiding this comment.
get_plan_bulk_with_cache() copies subscription_plan values from get_plan_bulk() into tenant_plans (and then Redis); if any value is None, it will be serialized (e.g., as null) and later fail schema validation, causing repeated cache misses and potential None values in the returned mapping.
Other Locations
api/services/billing_service.py:376
🤖 Was this useful? React with 👍 or 👎
| """Clean up Redis cache before and after each test.""" | ||
| with flask_app_with_containers.app_context(): | ||
| # Clean up before test | ||
| yield |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Benchmark PR from agentic-review-benchmarks#10