perf(core): Introduce concurrency control for main mode (#9453)

This commit is contained in:
Iván Ovejero
2024-06-12 15:05:43 +02:00
committed by GitHub
parent 6c1a4c8ebf
commit 797342343f
31 changed files with 919 additions and 57 deletions

View File

@@ -317,8 +317,12 @@ export class Worker extends BaseCommand {
Worker.jobQueue = Container.get(Queue);
await Worker.jobQueue.init();
this.logger.debug('Queue singleton ready');
const envConcurrency = config.getEnv('executions.concurrency.productionLimit');
const concurrency = envConcurrency !== -1 ? envConcurrency : flags.concurrency;
void Worker.jobQueue.process(
flags.concurrency,
concurrency,
async (job) => await this.runJob(job, this.nodeTypes),
);