summaryrefslogtreecommitdiff
path: root/vendor/github.com/minio/minio-go/v7/api.go
diff options
context:
space:
mode:
authorLibravatar dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2024-11-04 12:03:54 +0100
committerLibravatar GitHub <noreply@github.com>2024-11-04 12:03:54 +0100
commitd2820a14704622929fec7a00f0e4e8ee02b2f068 (patch)
treeac6036472301852893699023a01b63ee796b96aa /vendor/github.com/minio/minio-go/v7/api.go
parent[docs] Fix typos (#3498) (diff)
downloadgotosocial-d2820a14704622929fec7a00f0e4e8ee02b2f068.tar.xz
[chore]: Bump github.com/minio/minio-go/v7 from 7.0.79 to 7.0.80 (#3511)
Bumps [github.com/minio/minio-go/v7](https://github.com/minio/minio-go) from 7.0.79 to 7.0.80. - [Release notes](https://github.com/minio/minio-go/releases) - [Commits](https://github.com/minio/minio-go/compare/v7.0.79...v7.0.80) --- updated-dependencies: - dependency-name: github.com/minio/minio-go/v7 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Diffstat (limited to 'vendor/github.com/minio/minio-go/v7/api.go')
-rw-r--r--vendor/github.com/minio/minio-go/v7/api.go18
1 files changed, 14 insertions, 4 deletions
diff --git a/vendor/github.com/minio/minio-go/v7/api.go b/vendor/github.com/minio/minio-go/v7/api.go
index 54a20e711..380ec4fde 100644
--- a/vendor/github.com/minio/minio-go/v7/api.go
+++ b/vendor/github.com/minio/minio-go/v7/api.go
@@ -99,6 +99,7 @@ type Client struct {
healthStatus int32
trailingHeaderSupport bool
+ maxRetries int
}
// Options for New method
@@ -123,12 +124,16 @@ type Options struct {
// Custom hash routines. Leave nil to use standard.
CustomMD5 func() md5simd.Hasher
CustomSHA256 func() md5simd.Hasher
+
+ // Number of times a request is retried. Defaults to 10 retries if this option is not configured.
+ // Set to 1 to disable retries.
+ MaxRetries int
}
// Global constants.
const (
libraryName = "minio-go"
- libraryVersion = "v7.0.79"
+ libraryVersion = "v7.0.80"
)
// User Agent should always following the below style.
@@ -278,6 +283,11 @@ func privateNew(endpoint string, opts *Options) (*Client, error) {
// healthcheck is not initialized
clnt.healthStatus = unknown
+ clnt.maxRetries = MaxRetry
+ if opts.MaxRetries > 0 {
+ clnt.maxRetries = opts.MaxRetries
+ }
+
// Return.
return clnt, nil
}
@@ -590,9 +600,9 @@ func (c *Client) executeMethod(ctx context.Context, method string, metadata requ
return nil, errors.New(c.endpointURL.String() + " is offline.")
}
- var retryable bool // Indicates if request can be retried.
- var bodySeeker io.Seeker // Extracted seeker from io.Reader.
- reqRetry := MaxRetry // Indicates how many times we can retry the request
+ var retryable bool // Indicates if request can be retried.
+ var bodySeeker io.Seeker // Extracted seeker from io.Reader.
+ var reqRetry = c.maxRetries // Indicates how many times we can retry the request
if metadata.contentBody != nil {
// Check if body is seekable then it is retryable.