1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

chore: set proxy-repo interval to 45mins instead of 20secs (#6340)

Since we're polling for updates to max revision id every second, and
listening for update events for revision id in the proxy repository then
running a refresh interval of 20secs in the proxy repo refresh seems
excessive.

This PR changes the frequency of the refresh to once per 45mins.
This commit is contained in:
David Leek 2024-02-26 14:32:56 +01:00 committed by GitHub
parent 91c08593a6
commit f351ad821b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -148,7 +148,7 @@ exports[`should create default config 1`] = `
},
},
"frontendApi": {
"refreshIntervalInMs": 20000,
"refreshIntervalInMs": 2700000,
},
"frontendApiOrigins": [
"*",

View File

@ -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),
),
};