mirror of
https://github.com/Unleash/unleash.git
synced 2025-11-24 20:06:55 +01:00
chore: feature flag for startup tasks
This commit is contained in:
parent
1392b10727
commit
fa16545862
@ -35,6 +35,7 @@ import * as eventType from './types/events';
|
|||||||
import { Db } from './db/db';
|
import { Db } from './db/db';
|
||||||
import { defaultLockKey, defaultTimeout, withDbLock } from './util/db-lock';
|
import { defaultLockKey, defaultTimeout, withDbLock } from './util/db-lock';
|
||||||
import { scheduleServices } from './features/scheduler/schedule-services';
|
import { scheduleServices } from './features/scheduler/schedule-services';
|
||||||
|
import { scheduleStartupTasks } from './features/startup-tasks/startup-task-runner';
|
||||||
|
|
||||||
async function createApp(
|
async function createApp(
|
||||||
config: IUnleashConfig,
|
config: IUnleashConfig,
|
||||||
@ -50,6 +51,10 @@ async function createApp(
|
|||||||
await scheduleServices(services);
|
await scheduleServices(services);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (config.flagResolver.isEnabled('startupTasks')) {
|
||||||
|
await scheduleStartupTasks(services);
|
||||||
|
}
|
||||||
|
|
||||||
const metricsMonitor = createMetricsMonitor();
|
const metricsMonitor = createMetricsMonitor();
|
||||||
const unleashSession = sessionDb(config, db);
|
const unleashSession = sessionDb(config, db);
|
||||||
|
|
||||||
|
|||||||
@ -44,7 +44,8 @@ export type IFlagKey =
|
|||||||
| 'extendedUsageMetrics'
|
| 'extendedUsageMetrics'
|
||||||
| 'extendedUsageMetricsUI'
|
| 'extendedUsageMetricsUI'
|
||||||
| 'adminTokenKillSwitch'
|
| 'adminTokenKillSwitch'
|
||||||
| 'changeRequestConflictHandling';
|
| 'changeRequestConflictHandling'
|
||||||
|
| 'startupTasks';
|
||||||
|
|
||||||
export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;
|
export type IFlags = Partial<{ [key in IFlagKey]: boolean | Variant }>;
|
||||||
|
|
||||||
@ -203,6 +204,10 @@ const flags: IFlags = {
|
|||||||
process.env.UNLEASH_EXPERIMENTAL_CHANGE_REQUEST_CONFLICT_HANDLING,
|
process.env.UNLEASH_EXPERIMENTAL_CHANGE_REQUEST_CONFLICT_HANDLING,
|
||||||
false,
|
false,
|
||||||
),
|
),
|
||||||
|
startupTasks: parseEnvVarBoolean(
|
||||||
|
process.env.UNLEASH_EXPERIMENTAL_STARTUP_TASKS,
|
||||||
|
false,
|
||||||
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
export const defaultExperimentalOptions: IExperimentalOptions = {
|
export const defaultExperimentalOptions: IExperimentalOptions = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user