Skip to content

Commit

Permalink
fix(core): set max listeners to avoid warning when running high numbe…
Browse files Browse the repository at this point in the history
…rs of parallel tasks (#16993)
  • Loading branch information
AgentEnder authored May 13, 2023
1 parent b2470de commit c71027f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/nx/src/tasks-runner/task-orchestrator.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Workspaces } from '../config/workspaces';
import { defaultMaxListeners } from 'events';
import { performance } from 'perf_hooks';

import { Workspaces } from '../config/workspaces';
import { Hasher } from '../hasher/hasher';
import { ForkedProcessTaskRunner } from './forked-process-task-runner';
import { workspaceRoot } from '../utils/workspace-root';
Expand Down Expand Up @@ -65,6 +67,9 @@ export class TaskOrchestrator {

const threads = [];

process.stdout.setMaxListeners(this.options.parallel + defaultMaxListeners);
process.stderr.setMaxListeners(this.options.parallel + defaultMaxListeners);

// initial seeding of the queue
for (let i = 0; i < this.options.parallel; ++i) {
threads.push(this.executeNextBatchOfTasksUsingTaskSchedule());
Expand Down

1 comment on commit c71027f

@vercel
Copy link

@vercel vercel bot commented on c71027f May 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-dev-nrwl.vercel.app
nx.dev
nx-five.vercel.app
nx-dev-git-master-nrwl.vercel.app

Please sign in to comment.