Skip to content

Commit

Permalink
fix: do not push snaps concurrently (#3295)
Browse files Browse the repository at this point in the history
It seems that the error I get sometimes (#3257) is related to snap push
not being able to work concurrently.

I'm not a 100% sure though, so I'll try this and see how it goes.
If the error still happens, we can ignore the error or retry.

closes #3257
  • Loading branch information
caarlos0 committed Aug 7, 2022
1 parent 6708031 commit 2fecd94
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions internal/pipe/snapcraft/snapcraft.go
Expand Up @@ -201,14 +201,12 @@ func (Pipe) Publish(ctx *context.Context) error {
return pipe.ErrSkipPublishEnabled
}
snaps := ctx.Artifacts.Filter(artifact.ByType(artifact.PublishableSnapcraft)).List()
g := semerrgroup.New(ctx.Parallelism)
for _, snap := range snaps {
snap := snap
g.Go(func() error {
return push(ctx, snap)
})
if err := push(ctx, snap); err != nil {
return err
}
}
return g.Wait()
return nil
}

func create(ctx *context.Context, snap config.Snapcraft, arch string, binaries []*artifact.Artifact) error {
Expand Down

0 comments on commit 2fecd94

Please sign in to comment.