1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-17 01:17:29 +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):

![image](https://github.com/Unleash/unleash/assets/455064/306e57b8-6473-459a-8104-7223d1de40c3)
This commit is contained in:
Gastón Fournier 2024-04-02 11:25:38 +02:00 committed by GitHub
parent a30ddd81c5
commit 783c83173f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -107,6 +107,7 @@ import type { FeatureToggleInsert } from './feature-toggle-store';
import ArchivedFeatureError from '../../error/archivedfeature-error';
import { FEATURES_CREATED_BY_PROCESSED } from '../../metric-events';
import type { EventEmitter } from 'stream';
import { allSettledWithRejection } from '../../util/allSettledWithRejection';
interface IFeatureContext {
featureName: string;
@ -1717,7 +1718,7 @@ class FeatureToggleService {
user?: IUser,
shouldActivateDisabledStrategies = false,
): Promise<void> {
await Promise.all(
await allSettledWithRejection(
featureNames.map((featureName) =>
this.updateEnabled(
project,