diff --git a/libs/common/src/platform/misc/flags.ts b/libs/common/src/platform/misc/flags.ts index e0089a5451..a77a06debb 100644 --- a/libs/common/src/platform/misc/flags.ts +++ b/libs/common/src/platform/misc/flags.ts @@ -11,6 +11,7 @@ export type SharedFlags = { export type SharedDevFlags = { noopNotifications: boolean; skipWelcomeOnInstall: boolean; + configRetrievalIntervalMs: number; }; function getFlags(envFlags: string | T): T { diff --git a/libs/common/src/platform/services/config/default-config.service.ts b/libs/common/src/platform/services/config/default-config.service.ts index 71b76363a3..0a306348d7 100644 --- a/libs/common/src/platform/services/config/default-config.service.ts +++ b/libs/common/src/platform/services/config/default-config.service.ts @@ -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;