fix: caching issue with translate surveys (#2288)

This commit is contained in:
Matti Nannt
2024-03-19 20:36:28 +01:00
committed by GitHub
parent c611ed5cfe
commit 8f18e05075
2 changed files with 2 additions and 2 deletions

View File

@@ -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
export const MAU_LIMIT = IS_FORMBRICKS_CLOUD ? 9000 : 1000000;
// URLs

View File

@@ -357,7 +357,7 @@ export const transformToLegacySurvey = async (
const targetLanguage = languageCode ?? "default";
return reverseTranslateSurvey(survey, targetLanguage);
},
[`transformToLegacySurvey-${survey}`],
[`transformToLegacySurvey-${survey.id}-${languageCode}`],
{
tags: [surveyCache.tag.byId(survey.id)],
revalidate: SERVICES_REVALIDATION_INTERVAL,