File tree 3 files changed +15
-8
lines changed
3 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -177,12 +177,6 @@ func main() {
177
177
return
178
178
}
179
179
180
- if * jobsFlag > 0 {
181
- runtime .GOMAXPROCS (* jobsFlag )
182
- } else {
183
- runtime .GOMAXPROCS (runtime .NumCPU ())
184
- }
185
-
186
180
ctx := & types.Context {}
187
181
188
182
if * buildOptionsFileFlag != "" {
@@ -200,6 +194,14 @@ func main() {
200
194
ctx .InjectBuildOptions (buildOptions )
201
195
}
202
196
197
+ // Parallel Jobs flag
198
+ if * jobsFlag > 0 {
199
+ ctx .Jobs = * jobsFlag
200
+ } else {
201
+ ctx .Jobs = runtime .NumCPU ()
202
+ }
203
+ runtime .GOMAXPROCS (ctx .Jobs )
204
+
203
205
// FLAG_HARDWARE
204
206
if hardwareFolders , err := toSliceOfUnquoted (hardwareFoldersFlag ); err != nil {
205
207
printCompleteError (err )
Original file line number Diff line number Diff line change @@ -53,6 +53,10 @@ func (s *PrintUsedAndNotUsedLibraries) Run(ctx *types.Context) error {
53
53
return nil
54
54
}
55
55
56
+ if ctx .Jobs > 1 {
57
+ time .Sleep (100 * time .Millisecond )
58
+ }
59
+
56
60
logger := ctx .GetLogger ()
57
61
libraryResolutionResults := ctx .LibrariesResolutionResults
58
62
@@ -64,7 +68,5 @@ func (s *PrintUsedAndNotUsedLibraries) Run(ctx *types.Context) error {
64
68
}
65
69
}
66
70
67
- time .Sleep (100 * time .Millisecond )
68
-
69
71
return nil
70
72
}
Original file line number Diff line number Diff line change @@ -88,6 +88,9 @@ type Context struct {
88
88
89
89
// ReadFileAndStoreInContext command
90
90
FileToRead string
91
+
92
+ // Max jobs
93
+ Jobs int
91
94
}
92
95
93
96
func (ctx * Context ) ExtractBuildOptions () properties.Map {
You can’t perform that action at this time.
0 commit comments