Skip to content
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

Merged
merged 3 commits into from
Mar 19, 2024
Merged

Conversation

mattinannt
Copy link
Member

What does this PR do?

fix: caching issue with translate surveys

Copy link

vercel bot commented Mar 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
formbricks-cloud ⬜️ Ignored (Inspect) Mar 19, 2024 7:30pm
formbricks-com ⬜️ Ignored (Inspect) Visit Preview Mar 19, 2024 7:30pm

Copy link
Contributor

Thank you for following the naming conventions for pull request titles! 🙏

Copy link
Contributor

packages/lib/constants.ts

It'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.
Create Issue
See the diff
Checkout the fix

    const THREE_HOURS_IN_SECONDS = 60 * 60 * 3;
    export const SERVICES_REVALIDATION_INTERVAL = THREE_HOURS_IN_SECONDS; // 3 hours
git fetch origin && git checkout -b ReviewBot/Impro-thyz1g2 origin/ReviewBot/Impro-thyz1g2

@@ -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
Copy link
Contributor

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.

Suggested change
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

@mattinannt mattinannt added this pull request to the merge queue Mar 19, 2024
Merged via the queue into main with commit 8f18e05 Mar 19, 2024
14 of 16 checks passed
@mattinannt mattinannt deleted the feature/caching-issue branch March 19, 2024 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant