Add devFlag for the config service retrieval interval when developing (#9006)

* Add devFlag for a configurable config retrieval interval when developing

* Add Ms suffix to dev flag
This commit is contained in:
Shane Melton 2024-05-15 13:54:05 -07:00 committed by GitHub
parent db2f60b684
commit 385664c977
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 4 deletions

View File

@ -11,6 +11,7 @@ export type SharedFlags = {
export type SharedDevFlags = {
noopNotifications: boolean;
skipWelcomeOnInstall: boolean;
configRetrievalIntervalMs: number;
};
function getFlags<T>(envFlags: string | T): T {

View File

@ -1,13 +1,13 @@
import {
NEVER,
Observable,
Subject,
combineLatest,
firstValueFrom,
map,
mergeWith,
NEVER,
Observable,
of,
shareReplay,
Subject,
switchMap,
tap,
} from "rxjs";
@ -24,10 +24,13 @@ import { ConfigService } from "../../abstractions/config/config.service";
import { ServerConfig } from "../../abstractions/config/server-config";
import { EnvironmentService, Region } from "../../abstractions/environment.service";
import { LogService } from "../../abstractions/log.service";
import { devFlagEnabled, devFlagValue } from "../../misc/flags";
import { ServerConfigData } from "../../models/data/server-config.data";
import { CONFIG_DISK, KeyDefinition, StateProvider, UserKeyDefinition } from "../../state";
export const RETRIEVAL_INTERVAL = 3_600_000; // 1 hour
export const RETRIEVAL_INTERVAL = devFlagEnabled("configRetrievalIntervalMs")
? (devFlagValue("configRetrievalIntervalMs") as number)
: 3_600_000; // 1 hour
export type ApiUrl = string;