-
Notifications
You must be signed in to change notification settings - Fork 0
Cache organizations and events longer in case of error. #355
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
For example, if/when us-east-2 goes down, we can still serve some semblance of data on core website routes.
💰 Infracost reportMonthly estimate generatedThis comment will be updated when code changes. |
|
Caution Review failedThe pull request is closed. WalkthroughAdded a new exported cache-duration constant and updated two API route cache-policy strings to use that constant and to double the stale-while-revalidate windows; no control-flow or error-handling changes. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to data retention organization setting 📒 Files selected for processing (1)
Comment |
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
📒 Files selected for processing (3)
src/api/routes/events.ts(2 hunks)src/api/routes/organizations.ts(2 hunks)src/common/config.ts(1 hunks)
🧰 Additional context used
🪛 ESLint
src/common/config.ts
[error] 206-206: Insert ;
(prettier/prettier)
src/api/routes/events.ts
[error] 16-16: Unexpected use of file extension "js" for "../../common/config.js"
(import/extensions)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Build Application
- GitHub Check: Run Unit Tests
🔇 Additional comments (4)
src/api/routes/organizations.ts (2)
36-36: LGTM!The import is correctly added to support the updated cache policy.
52-52: Well-structured cache policy for resilience.The updated cache policy correctly implements the PR objective by using
stale-if-errorwith a 1-day window, allowing stale content to be served during AWS outages. The dynamicstale-while-revalidatecalculation (2x the base duration) is also a good practice.src/api/routes/events.ts (2)
12-16: LGTM!The import is correctly updated to include the new constant.
125-125: Excellent resilience improvement.The cache policy change correctly implements extended caching during errors. With
max-age=120,stale-while-revalidate=240, andstale-if-error=86400, events will remain accessible for up to 1 day during AWS outages while maintaining fresh data under normal conditions.
For example, if/when us-east-2 goes down, we can still serve some semblance of data on core website routes.
Summary by CodeRabbit