From fc9be62eb86931dc95e5cd3cc520858825051c73 Mon Sep 17 00:00:00 2001 From: Eugene Molodkin Date: Fri, 27 Dec 2024 16:23:26 +0100 Subject: [PATCH] wip: fix concurrency queues initialization --- .../concurrency/__tests__/concurrency-control.service.test.ts | 2 ++ packages/cli/src/concurrency/concurrency-control.service.ts | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/concurrency/__tests__/concurrency-control.service.test.ts b/packages/cli/src/concurrency/__tests__/concurrency-control.service.test.ts index 1b7df31473156..769d8a0132a09 100644 --- a/packages/cli/src/concurrency/__tests__/concurrency-control.service.test.ts +++ b/packages/cli/src/concurrency/__tests__/concurrency-control.service.test.ts @@ -57,6 +57,8 @@ describe('ConcurrencyControlService', () => { expect(service.isEnabled).toBe(true); // @ts-expect-error Private property expect(service.queues.get(type)).toBeDefined(); + // @ts-expect-error Private property + expect(service.queues.size).toBe(1); }, ); diff --git a/packages/cli/src/concurrency/concurrency-control.service.ts b/packages/cli/src/concurrency/concurrency-control.service.ts index 18991b40e96e7..2d58c9289ba0a 100644 --- a/packages/cli/src/concurrency/concurrency-control.service.ts +++ b/packages/cli/src/concurrency/concurrency-control.service.ts @@ -63,7 +63,9 @@ export class ConcurrencyControlService { this.queues = new Map(); this.limits.forEach((limit, type) => { - this.queues.set(type, new ConcurrencyQueue(limit)); + if (limit > 0) { + this.queues.set(type, new ConcurrencyQueue(limit)); + } }); this.logInit();