mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-04-13 11:50:34 +02:00
update retry package version (#972)
This commit is contained in:
parent
844676121b
commit
b84f6cdcb2
5
go.mod
5
go.mod
@ -6,19 +6,18 @@ require (
|
||||
github.com/aws/aws-sdk-go v1.15.64
|
||||
github.com/caarlos0/ctrlc v1.0.0
|
||||
github.com/campoy/unique v0.0.0-20180121183637-88950e537e7e
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/fatih/color v1.7.0
|
||||
github.com/google/go-github v17.0.0+incompatible
|
||||
github.com/google/go-querystring v1.0.0 // indirect
|
||||
github.com/goreleaser/nfpm v0.9.7
|
||||
github.com/imdario/mergo v0.3.6
|
||||
github.com/kamilsk/retry/v3 v3.4.4
|
||||
github.com/kamilsk/retry/v4 v4.0.0
|
||||
github.com/mattn/go-colorable v0.0.9 // indirect
|
||||
github.com/mattn/go-isatty v0.0.4 // indirect
|
||||
github.com/mattn/go-zglob v0.0.0-20180803001819-2ea3427bfa53
|
||||
github.com/mitchellh/go-homedir v1.0.0
|
||||
github.com/pkg/errors v0.8.0
|
||||
github.com/stretchr/testify v1.2.2
|
||||
github.com/stretchr/testify v1.3.0
|
||||
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519 // indirect
|
||||
golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4
|
||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f
|
||||
|
9
go.sum
9
go.sum
@ -34,8 +34,8 @@ github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
|
||||
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
|
||||
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8 h1:12VvqtR6Aowv3l/EQUlocDHW2Cp4G9WJVH7uyH8QFJE=
|
||||
github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
|
||||
github.com/kamilsk/retry/v3 v3.4.4 h1:lnmlAKiNtllJLzv2brlnW8g3NhbDEay9sq4ecBr3Nk0=
|
||||
github.com/kamilsk/retry/v3 v3.4.4/go.mod h1:4aG7zHzQa5sg2zzm7r0bIFu3hBA+x7kRpxs5cJQg/x8=
|
||||
github.com/kamilsk/retry/v4 v4.0.0 h1:XmnWZpK3FMoDGn28njHUkLzT92YRxAuV0GA0I+OPY6g=
|
||||
github.com/kamilsk/retry/v4 v4.0.0/go.mod h1:0af33qDvzbhQqdOBi7iOjEpmP4brbPmNZpo7chYlgcc=
|
||||
github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
|
||||
@ -49,9 +49,10 @@ github.com/pkg/errors v0.8.0 h1:WdK/asTD0HN+q6hsWO3/vpuAkAr+tw6aNJNDFFf0+qw=
|
||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519 h1:x6rhz8Y9CjbgQkccRGmELH6K+LJj7tOoh3XWeC1yaQM=
|
||||
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||
|
@ -10,9 +10,9 @@ import (
|
||||
"github.com/goreleaser/goreleaser/internal/pipe"
|
||||
"github.com/goreleaser/goreleaser/internal/semerrgroup"
|
||||
"github.com/goreleaser/goreleaser/pkg/context"
|
||||
"github.com/kamilsk/retry/v3"
|
||||
"github.com/kamilsk/retry/v3/backoff"
|
||||
"github.com/kamilsk/retry/v3/strategy"
|
||||
"github.com/kamilsk/retry/v4"
|
||||
"github.com/kamilsk/retry/v4/backoff"
|
||||
"github.com/kamilsk/retry/v4/strategy"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
@ -88,7 +88,7 @@ func doPublish(ctx *context.Context, c client.Client) error {
|
||||
artifact := artifact
|
||||
g.Go(func() error {
|
||||
var repeats uint
|
||||
action := func(try uint) error {
|
||||
what := func(try uint) error {
|
||||
repeats = try + 1
|
||||
if uploadErr := upload(ctx, c, releaseID, artifact); uploadErr != nil {
|
||||
log.WithFields(log.Fields{
|
||||
@ -99,12 +99,12 @@ func doPublish(ctx *context.Context, c client.Client) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
strategies := []strategy.Strategy{
|
||||
how := []func(uint, error) bool{
|
||||
strategy.Limit(10),
|
||||
strategy.Backoff(backoff.Linear(50 * time.Millisecond)),
|
||||
}
|
||||
if retryErr := retry.Retry(ctx.Done(), action, strategies...); retryErr != nil {
|
||||
return errors.Wrapf(retryErr, "failed to upload %s after %d retries", artifact.Name, repeats)
|
||||
if err := retry.Try(ctx, what, how...); err != nil {
|
||||
return errors.Wrapf(err, "failed to upload %s after %d retries", artifact.Name, repeats)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user