Skip to content

Commit

Permalink
fix(core): schedule tasks with the most tasks that depend on it first (
Browse files Browse the repository at this point in the history
  • Loading branch information
skrtheboss committed Nov 7, 2022
1 parent dd09982 commit 59ed6f1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/nx/src/tasks-runner/tasks-schedule.ts
Expand Up @@ -99,7 +99,14 @@ export class TasksSchedule {
[taskId]
);
this.options.lifeCycle.scheduleTask(task);
this.scheduledTasks.push(taskId);
this.scheduledTasks = this.scheduledTasks
.concat(taskId)
// NOTE: sort task by most dependent on first
.sort(
(taskId1, taskId2) =>
this.reverseTaskDeps[taskId2].length -
this.reverseTaskDeps[taskId1].length
);
}

private scheduleBatches() {
Expand Down

1 comment on commit 59ed6f1

@vercel
Copy link

@vercel vercel bot commented on 59ed6f1 Nov 7, 2022

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-git-master-nrwl.vercel.app
nx.dev
nx-five.vercel.app

Please sign in to comment.