Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

update configcat pollIntervalSeconds to 5 minutes

Alaister Young484ee4c671dd
diff --git a/studio/components/ui/Flag/FlagProvider.tsx b/studio/components/ui/Flag/FlagProvider.tsx
index e521fec1a65..40d1ac7dae8 100644
--- a/studio/components/ui/Flag/FlagProvider.tsx
+++ b/studio/components/ui/Flag/FlagProvider.tsx
@@ -16,20 +16,12 @@ const FlagProvider: FC = ({ children }) => {
const { Provider } = FlagContext
const [store, setStore] = useState({})
- useEffect(() => {
- // [Joshen] getFlags get triggered everytime the tab refocuses but this should be okay
- // as per https://configcat.com/docs/sdk-reference/js/#polling-modes:
- // The polling downloads the config.json at the set interval and are stored in the internal cache
- // which subsequently all getValueAsync() calls are served from there
- if (IS_PLATFORM) getFlags(profile)
- }, [profile])
-
const getFlags = async (user?: User) => {
if (!client) {
client = configcat.getClient(
process.env.NEXT_PUBLIC_CONFIGCAT_SDK_KEY ?? '',
configcat.PollingMode.AutoPoll,
- { pollIntervalSeconds: 10 }
+ { pollIntervalSeconds: 600 }
)
}
@@ -44,6 +36,14 @@ const FlagProvider: FC = ({ children }) => {
setStore(flagStore)
}
+ useEffect(() => {
+ // [Joshen] getFlags get triggered everytime the tab refocuses but this should be okay
+ // as per https://configcat.com/docs/sdk-reference/js/#polling-modes:
+ // The polling downloads the config.json at the set interval and are stored in the internal cache
+ // which subsequently all getValueAsync() calls are served from there
+ if (IS_PLATFORM) getFlags(profile)
+ }, [profile])
+
return <Provider value={store}>{children}</Provider>
}