-
Notifications
You must be signed in to change notification settings - Fork 941
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
fix: caching issue with translate surveys #2288
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
Thank you for following the naming conventions for pull request titles! 🙏 |
packages/lib/constants.tsIt's a good practice to avoid magic numbers in the code. Instead, use constants with meaningful names. This makes the code more readable and maintainable. const THREE_HOURS_IN_SECONDS = 60 * 60 * 3;
export const SERVICES_REVALIDATION_INTERVAL = THREE_HOURS_IN_SECONDS; // 3 hours
|
@@ -4,7 +4,7 @@ import { env } from "./env"; | |||
|
|||
export const IS_FORMBRICKS_CLOUD = env.IS_FORMBRICKS_CLOUD === "1"; | |||
export const REVALIDATION_INTERVAL = 0; //TODO: find a good way to cache and revalidate data when it changes | |||
export const SERVICES_REVALIDATION_INTERVAL = 60 * 30; // 30 minutes | |||
export const SERVICES_REVALIDATION_INTERVAL = 60 * 60 * 3; // 3 hours |
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.
Replace the magic number with a constant to improve code readability and maintainability.
export const SERVICES_REVALIDATION_INTERVAL = 60 * 60 * 3; // 3 hours | |
const THREE_HOURS_IN_SECONDS = 60 * 60 * 3; | |
export const SERVICES_REVALIDATION_INTERVAL = THREE_HOURS_IN_SECONDS; // 3 hours |
What does this PR do?
fix: caching issue with translate surveys