1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

chore: remove emitPotentiallyStaleEvents flag (#4537)

This commit is contained in:
Jaanus Sellin 2023-08-21 14:35:35 +03:00 committed by GitHub
parent 6cefb6021e
commit 68273da213
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 28 deletions

View File

@ -78,7 +78,6 @@ exports[`should create default config 1`] = `
"disableNotifications": false,
"embedProxy": true,
"embedProxyFrontend": true,
"emitPotentiallyStaleEvents": false,
"featuresExportImport": true,
"filterInvalidClientMetrics": false,
"frontendNavigationUpdate": false,
@ -115,7 +114,6 @@ exports[`should create default config 1`] = `
"disableNotifications": false,
"embedProxy": true,
"embedProxyFrontend": true,
"emitPotentiallyStaleEvents": false,
"featuresExportImport": true,
"filterInvalidClientMetrics": false,
"frontendNavigationUpdate": false,

View File

@ -44,7 +44,6 @@ test('Should only store events for potentially stale on', async () => {
flagResolver: { isEnabled: () => true },
experimental: {
...(config.experimental ?? {}),
emitPotentiallyStaleEvents: true,
},
} as unknown as IUnleashConfig,
{} as ISegmentService,

View File

@ -2063,25 +2063,23 @@ class FeatureToggleService {
async updatePotentiallyStaleFeatures(): Promise<void> {
const potentiallyStaleFeatures =
await this.featureToggleStore.updatePotentiallyStaleFeatures();
if (this.flagResolver.isEnabled('emitPotentiallyStaleEvents')) {
if (potentiallyStaleFeatures.length > 0) {
return this.eventStore.batchStore(
await Promise.all(
potentiallyStaleFeatures
.filter((feature) => feature.potentiallyStale)
.map(
async ({ name, project }) =>
new PotentiallyStaleOnEvent({
featureName: name,
project,
tags: await this.tagStore.getAllTagsForFeature(
name,
),
}),
),
),
);
}
if (potentiallyStaleFeatures.length > 0) {
return this.eventStore.batchStore(
await Promise.all(
potentiallyStaleFeatures
.filter((feature) => feature.potentiallyStale)
.map(
async ({ name, project }) =>
new PotentiallyStaleOnEvent({
featureName: name,
project,
tags: await this.tagStore.getAllTagsForFeature(
name,
),
}),
),
),
);
}
}
}

View File

@ -22,7 +22,6 @@ export type IFlagKey =
| 'advancedPlayground'
| 'strategyVariant'
| 'slackAppAddon'
| 'emitPotentiallyStaleEvents'
| 'configurableFeatureTypeLifetimes'
| 'filterInvalidClientMetrics'
| 'frontendNavigationUpdate'
@ -106,10 +105,6 @@ const flags: IFlags = {
process.env.UNLEASH_SLACK_APP_ADDON,
false,
),
emitPotentiallyStaleEvents: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_EMIT_POTENTIALLY_STALE_EVENTS,
false,
),
configurableFeatureTypeLifetimes: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_CONFIGURABLE_FEATURE_TYPE_LIFETIMES,
false,

View File

@ -38,7 +38,6 @@ process.nextTick(async () => {
anonymiseEventLog: false,
responseTimeWithAppNameKillSwitch: false,
strategyVariant: true,
emitPotentiallyStaleEvents: true,
slackAppAddon: true,
configurableFeatureTypeLifetimes: true,
frontendNavigationUpdate: true,