1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-21 16:18:28 +01:00

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 = { export type SharedDevFlags = {
noopNotifications: boolean; noopNotifications: boolean;
skipWelcomeOnInstall: boolean; skipWelcomeOnInstall: boolean;
configRetrievalIntervalMs: number;
}; };
function getFlags<T>(envFlags: string | T): T { function getFlags<T>(envFlags: string | T): T {

View File

@ -1,13 +1,13 @@
import { import {
NEVER,
Observable,
Subject,
combineLatest, combineLatest,
firstValueFrom, firstValueFrom,
map, map,
mergeWith, mergeWith,
NEVER,
Observable,
of, of,
shareReplay, shareReplay,
Subject,
switchMap, switchMap,
tap, tap,
} from "rxjs"; } from "rxjs";
@ -24,10 +24,13 @@ import { ConfigService } from "../../abstractions/config/config.service";
import { ServerConfig } from "../../abstractions/config/server-config"; import { ServerConfig } from "../../abstractions/config/server-config";
import { EnvironmentService, Region } from "../../abstractions/environment.service"; import { EnvironmentService, Region } from "../../abstractions/environment.service";
import { LogService } from "../../abstractions/log.service"; import { LogService } from "../../abstractions/log.service";
import { devFlagEnabled, devFlagValue } from "../../misc/flags";
import { ServerConfigData } from "../../models/data/server-config.data"; import { ServerConfigData } from "../../models/data/server-config.data";
import { CONFIG_DISK, KeyDefinition, StateProvider, UserKeyDefinition } from "../../state"; 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; export type ApiUrl = string;