-
Notifications
You must be signed in to change notification settings - Fork 7
fix: cache get_program_variants response #518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request adds caching to the get_program_variants method to improve performance by reducing redundant API calls to Commercetools. The cache stores program variant data for approximately 24 hours.
Changes:
- Added a new cache TTL constant (
GET_PROGRAM_CACHE_TTL_SECS) set to 23 hours and 59 minutes - Implemented caching logic in
get_program_variantsusingTieredCacheto store and retrieve program variant data - Updated the test for
get_program_variantsto verify caching behavior
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| commerce_coordinator/apps/commercetools/constants.py | Added cache TTL constant for program variants caching |
| commerce_coordinator/apps/commercetools/http_api_client.py | Implemented caching logic in get_program_variants method with cache key generation and storage |
| commerce_coordinator/apps/commercetools/tests/test_http_api_client.py | Updated test to include cache verification and added tearDown to clear cache between tests |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
0818f48 to
4dd44de
Compare
4dd44de to
70aa94b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
70aa94b to
bd6bae3
Compare
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
https://redventures.atlassian.net/browse/EDUN-8253
Cache
get_program_variantsresponse byproduct_key, refreshing after 4 hoursMerge checklist:
Check off if complete or not applicable:
Post-merge: