From faf1eba6ff381cac0f4536ec588131b464af0b4a Mon Sep 17 00:00:00 2001 From: Jan Keromnes Date: Fri, 24 Jun 2022 10:56:09 +0000 Subject: [PATCH] [server][dashboard] Disable 5 second delay before returning feature flag value Co-authored-by: Milan Pavlik --- components/dashboard/src/experiments/configcat.ts | 2 ++ components/server/src/experiments.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/components/dashboard/src/experiments/configcat.ts b/components/dashboard/src/experiments/configcat.ts index b3466592ad448c..16430944037fb0 100644 --- a/components/dashboard/src/experiments/configcat.ts +++ b/components/dashboard/src/experiments/configcat.ts @@ -23,6 +23,7 @@ export function newProductionConfigCatClient(): Client { // clientKey is an identifier of our ConfigCat application. It is not a secret. const clientKey = "WBLaCPtkjkqKHlHedziE9g/TwAe6YyftEGPnGxVRXd0Ig"; const client = configcat.createClient(clientKey, { + maxInitWaitTimeSeconds: 0, logger: configcat.createConsoleLogger(2), }); @@ -35,6 +36,7 @@ export function newNonProductionConfigCatClient(): Client { // clientKey is an identifier of our ConfigCat application. It is not a secret. const clientKey = "WBLaCPtkjkqKHlHedziE9g/LEAOCNkbuUKiqUZAcVg7dw"; const client = configcat.createClient(clientKey, { + maxInitWaitTimeSeconds: 0, pollIntervalSeconds: 60 * 3, // 3 minutes logger: configcat.createConsoleLogger(3), }); diff --git a/components/server/src/experiments.ts b/components/server/src/experiments.ts index e428b83aed7048..6067039b9f9162 100644 --- a/components/server/src/experiments.ts +++ b/components/server/src/experiments.ts @@ -14,6 +14,7 @@ export function getExperimentsClient(): IConfigCatClient { if (client === undefined) { client = configcat.createClient("WBLaCPtkjkqKHlHedziE9g/LEAOCNkbuUKiqUZAcVg7dw", { // <-- This is the actual SDK Key for your Test environment + maxInitWaitTimeSeconds: 0, logger: logger, }); }