Skip to content
Permalink
Browse files

fix: snapcraft: respect parallelism

  • Loading branch information...
caarlos0 committed May 27, 2018
1 parent 92abd2e commit eb2ff88747c51311e1ebe3b38ac92d903718721c
Showing with 5 additions and 0 deletions.
  1. +5 −0 pipeline/snapcraft/snapcraft.go
@@ -83,15 +83,20 @@ func (Pipe) Run(ctx *context.Context) error {
}

var g errgroup.Group
sem := make(chan bool, ctx.Parallelism)
for platform, binaries := range ctx.Artifacts.Filter(
artifact.And(
artifact.ByGoos("linux"),
artifact.ByType(artifact.Binary),
),
).GroupByPlatform() {
sem <- true
arch := linux.Arch(platform)
binaries := binaries
g.Go(func() error {
go func() {
<-sem
}()
return create(ctx, arch, binaries)
})
}

0 comments on commit eb2ff88

Please sign in to comment.
You can’t perform that action at this time.