mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-02-01 13:07:49 +02:00
parent
3340f0b026
commit
6e09a19a83
@ -133,6 +133,18 @@ func (c *githubClient) Upload(
|
||||
releaseID int64,
|
||||
name string,
|
||||
file *os.File,
|
||||
) error {
|
||||
return c.uploadRetry(ctx, releaseID, name, file, 0)
|
||||
}
|
||||
|
||||
const maxRetries = 10
|
||||
|
||||
func (c *githubClient) uploadRetry(
|
||||
ctx *context.Context,
|
||||
releaseID int64,
|
||||
name string,
|
||||
file *os.File,
|
||||
retry int,
|
||||
) error {
|
||||
_, _, err := c.client.Repositories.UploadReleaseAsset(
|
||||
ctx,
|
||||
@ -144,5 +156,11 @@ func (c *githubClient) Upload(
|
||||
},
|
||||
file,
|
||||
)
|
||||
return err
|
||||
if err != nil {
|
||||
if retry > maxRetries {
|
||||
return err
|
||||
}
|
||||
return err
|
||||
}
|
||||
return c.uploadRetry(ctx, releaseID, name, file, retry+1)
|
||||
}
|
||||
|
@ -46,4 +46,3 @@ func (Pipe) Publish(ctx *context.Context) error {
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user