diff --git a/build/builder.go b/build/builder.go index a442f57d..455e6f38 100644 --- a/build/builder.go +++ b/build/builder.go @@ -854,8 +854,8 @@ func (b *Builder) flush() error { if b.opts.Parallelism > 1 && b.opts.MemProfile == "" { b.building.Add(1) + b.throttle <- 1 go func() { - b.throttle <- 1 done, err := b.buildShard(todo, shard) <-b.throttle