Skip to content

Commit 619a7e8

Browse files
authoredFeb 11, 2022
fix(core): wait for tasks to be scheduled before checking for work (#8840)
Ensure task are scheduled before checking if there is some work to do, else it can occur that tasks are scheduled, but no check for work is triggered until the next task completes. Closes #8888.
1 parent 5bf37f0 commit 619a7e8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎packages/workspace/src/tasks-runner/task-orchestrator.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,10 @@ export class TaskOrchestrator {
384384
);
385385

386386
await this.tasksSchedule.scheduleNextTasks();
387+
388+
// release blocked threads
389+
this.waitingForTasks.forEach((f) => f(null));
390+
this.waitingForTasks.length = 0;
387391
}
388392

389393
private complete(
@@ -408,9 +412,6 @@ export class TaskOrchestrator {
408412
);
409413
}
410414
}
411-
this.waitingForTasks // release blocked threads
412-
.forEach((f) => f(null));
413-
this.waitingForTasks.length = 0;
414415
}
415416

416417
//endregion Lifecycle

0 commit comments

Comments
 (0)
Please sign in to comment.