Skip to content

Commit

Permalink
chore: when some promise fails others might hang and leave open conns (
Browse files Browse the repository at this point in the history
…#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)
  • Loading branch information
gastonfournier committed Apr 2, 2024
1 parent a30ddd8 commit 783c831
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/features/feature-toggle/feature-toggle-service.ts
Expand Up @@ -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;
Expand Down Expand Up @@ -1717,7 +1718,7 @@ class FeatureToggleService {
user?: IUser,
shouldActivateDisabledStrategies = false,
): Promise<void> {
await Promise.all(
await allSettledWithRejection(
featureNames.map((featureName) =>
this.updateEnabled(
project,
Expand Down

0 comments on commit 783c831

Please sign in to comment.