Skip to content

Commit

Permalink
chore: set proxy-repo interval to 45mins instead of 20secs (#6340)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
daveleek committed Feb 26, 2024
1 parent 91c0859 commit f351ad8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/lib/__snapshots__/create-config.test.ts.snap
Expand Up @@ -148,7 +148,7 @@ exports[`should create default config 1`] = `
},
},
"frontendApi": {
"refreshIntervalInMs": 20000,
"refreshIntervalInMs": 2700000,
},
"frontendApiOrigins": [
"*",
Expand Down
8 changes: 6 additions & 2 deletions src/lib/create-config.ts
Expand Up @@ -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,
Expand Down Expand Up @@ -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),
),
};

Expand Down

0 comments on commit f351ad8

Please sign in to comment.