mirror of
https://github.com/Unleash/unleash.git
synced 2025-07-12 13:48:35 +02:00
chore: when some promise fails others might hang and leave open conns (#6636)
This was identified during some tests where we noticed jest did not complete properly (notice how after linking unleash-server to this commit it didn't have that issue): 
This commit is contained in:
parent
a30ddd81c5
commit
783c83173f
@ -107,6 +107,7 @@ import type { FeatureToggleInsert } from './feature-toggle-store';
|
|||||||
import ArchivedFeatureError from '../../error/archivedfeature-error';
|
import ArchivedFeatureError from '../../error/archivedfeature-error';
|
||||||
import { FEATURES_CREATED_BY_PROCESSED } from '../../metric-events';
|
import { FEATURES_CREATED_BY_PROCESSED } from '../../metric-events';
|
||||||
import type { EventEmitter } from 'stream';
|
import type { EventEmitter } from 'stream';
|
||||||
|
import { allSettledWithRejection } from '../../util/allSettledWithRejection';
|
||||||
|
|
||||||
interface IFeatureContext {
|
interface IFeatureContext {
|
||||||
featureName: string;
|
featureName: string;
|
||||||
@ -1717,7 +1718,7 @@ class FeatureToggleService {
|
|||||||
user?: IUser,
|
user?: IUser,
|
||||||
shouldActivateDisabledStrategies = false,
|
shouldActivateDisabledStrategies = false,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await Promise.all(
|
await allSettledWithRejection(
|
||||||
featureNames.map((featureName) =>
|
featureNames.map((featureName) =>
|
||||||
this.updateEnabled(
|
this.updateEnabled(
|
||||||
project,
|
project,
|
||||||
|
Loading…
Reference in New Issue
Block a user