swap semaquire and wg.Add to avoid a deadlock

pull/7501/head
Adrien Delorme 7 years ago
parent 263f318e82
commit d40d3eca88

@ -180,13 +180,13 @@ func (c *BuildCommand) Run(args []string) int {
b := builds[i]
name := b.Name()
ui := buildUis[name]
// Increment the waitgroup so we wait for this item to finish properly
wg.Add(1)
if err := limitParallel.Acquire(buildCtx, 1); err != nil {
ui.Error(fmt.Sprintf("Build '%s' failed to acquire semaphore: %s", name, err))
errors[name] = err
break
}
// Increment the waitgroup so we wait for this item to finish properly
wg.Add(1)
// Run the build in a goroutine
go func() {

Loading…
Cancel
Save