Skip to content

Commit

Permalink
fix(artifacts): moved transient error codes to a new file
Browse files Browse the repository at this point in the history
Signed-off-by: Peixuan Ding <dingpeixuan911@gmail.com>
  • Loading branch information
dinever committed Apr 13, 2021
1 parent 843df46 commit fdc209a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
14 changes: 14 additions & 0 deletions workflow/artifacts/s3/error_codes.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package s3

// s3TransientErrorCodes is a list of S3 error codes that are transient (retryable)
// Reference: https://github.com/minio/minio-go/blob/92fe50d14294782d96402deb861d442992038109/retry.go#L90-L102
var s3TransientErrorCodes = []string{
"InternalError",
"RequestTimeout",
"Throttling",
"ThrottlingException",
"RequestLimitExceeded",
"RequestThrottled",
"InternalError",
"SlowDown",
}
13 changes: 0 additions & 13 deletions workflow/artifacts/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,6 @@ type ArtifactDriver struct {
Context context.Context
}

// s3TransientErrorCodes is a list of S3 error codes that are transient (retryable)
// Reference: https://github.com/minio/minio-go/blob/92fe50d14294782d96402deb861d442992038109/retry.go#L90-L102
var s3TransientErrorCodes = []string{
"InternalError",
"RequestTimeout",
"Throttling",
"ThrottlingException",
"RequestLimitExceeded",
"RequestThrottled",
"InternalError",
"SlowDown",
}

var (
_ artifactscommon.ArtifactDriver = &ArtifactDriver{}
defaultRetry = wait.Backoff{Duration: time.Second * 2, Factor: 2.0, Steps: 5, Jitter: 0.1}
Expand Down

0 comments on commit fdc209a

Please sign in to comment.