diff --git a/src/lib/__snapshots__/create-config.test.ts.snap b/src/lib/__snapshots__/create-config.test.ts.snap index 1319d83d6e..713d0c8b2e 100644 --- a/src/lib/__snapshots__/create-config.test.ts.snap +++ b/src/lib/__snapshots__/create-config.test.ts.snap @@ -148,7 +148,7 @@ exports[`should create default config 1`] = ` }, }, "frontendApi": { - "refreshIntervalInMs": 20000, + "refreshIntervalInMs": 2700000, }, "frontendApiOrigins": [ "*", diff --git a/src/lib/create-config.ts b/src/lib/create-config.ts index 661efe1450..597aafd33c 100644 --- a/src/lib/create-config.ts +++ b/src/lib/create-config.ts @@ -24,7 +24,11 @@ import { import { getDefaultLogProvider, LogLevel, validateLogProvider } from './logger'; import { defaultCustomAuthDenyAll } from './default-custom-auth-deny-all'; import { formatBaseUri } from './util/format-base-uri'; -import { hoursToMilliseconds, secondsToMilliseconds } from 'date-fns'; +import { + hoursToMilliseconds, + minutesToMilliseconds, + secondsToMilliseconds, +} from 'date-fns'; import EventEmitter from 'events'; import { ApiTokenType, @@ -514,7 +518,7 @@ export function createConfig(options: IUnleashOptions): IUnleashConfig { const frontendApi = options.frontendApi || { refreshIntervalInMs: parseEnvVarNumber( process.env.FRONTEND_API_REFRESH_INTERVAL_MS, - 20000, + minutesToMilliseconds(45), ), };