-
Notifications
You must be signed in to change notification settings - Fork 763
Add --builders to limit number of projects can build concurrently #2307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,6 +61,8 @@ type Orchestrator struct { | |
| tasks *collections.SyncMap[tspath.Path, *BuildTask] | ||
| order []string | ||
| errors []*ast.Diagnostic | ||
| // Semaphore to limit concurrent builds | ||
| buildSemaphore chan struct{} | ||
|
|
||
| errorSummaryReporter tsc.DiagnosticsReporter | ||
| watchStatusReporter tsc.DiagnosticReporter | ||
|
|
@@ -396,5 +398,9 @@ func NewOrchestrator(opts Options) *Orchestrator { | |
| } else { | ||
| orchestrator.errorSummaryReporter = tsc.CreateReportErrorSummary(opts.Sys, opts.Command.Locale(), opts.Command.CompilerOptions) | ||
| } | ||
| // If we want to build more than one project at a time, create a semaphore to limit concurrency | ||
| if builders := opts.Command.BuildOptions.Builders; builders != nil { | ||
| orchestrator.buildSemaphore = make(chan struct{}, *builders) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, I see that you added something to config parsing for this. |
||
| } | ||
| return orchestrator | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to double check, we don't actually load anything related to the project until after this point, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct. we actually create program and do emit after this.
this does not affect uptodate ness checks