mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-30 04:20:53 +00:00
Upgrade AWS SDK to the latest version
This commit is contained in:
+17
-6
@@ -26,19 +26,30 @@ func (d retryer) RetryRules(r *request.Request) time.Duration {
|
||||
|
||||
func init() {
|
||||
initClient = func(c *client.Client) {
|
||||
r := retryer{}
|
||||
if c.Config.MaxRetries == nil || aws.IntValue(c.Config.MaxRetries) == aws.UseServiceDefaultRetries {
|
||||
r.NumMaxRetries = 10
|
||||
} else {
|
||||
r.NumMaxRetries = *c.Config.MaxRetries
|
||||
if c.Config.Retryer == nil {
|
||||
// Only override the retryer with a custom one if the config
|
||||
// does not already contain a retryer
|
||||
setCustomRetryer(c)
|
||||
}
|
||||
c.Retryer = r
|
||||
|
||||
c.Handlers.Build.PushBack(disableCompression)
|
||||
c.Handlers.Unmarshal.PushFront(validateCRC32)
|
||||
}
|
||||
}
|
||||
|
||||
func setCustomRetryer(c *client.Client) {
|
||||
maxRetries := aws.IntValue(c.Config.MaxRetries)
|
||||
if c.Config.MaxRetries == nil || maxRetries == aws.UseServiceDefaultRetries {
|
||||
maxRetries = 10
|
||||
}
|
||||
|
||||
c.Retryer = retryer{
|
||||
DefaultRetryer: client.DefaultRetryer{
|
||||
NumMaxRetries: maxRetries,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func drainBody(b io.ReadCloser, length int64) (out *bytes.Buffer, err error) {
|
||||
if length < 0 {
|
||||
length = 0
|
||||
|
||||
Reference in New Issue
Block a user