From e467f5e9b468cba686f8da0abd77f9e9a29dfbcb 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 1b7df314731563..769d8a0132a091 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 060375457484e2..47edd51addaf40 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();