-
Notifications
You must be signed in to change notification settings - Fork 433
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a00965
commit 8c939f7
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package s3 | ||
|
||
import ( | ||
"strings" | ||
|
||
"github.com/aws/aws-sdk-go/aws/request" | ||
) | ||
|
||
func NewConnResetRetryer(baseRetryer request.Retryer) *ConnResetRetryer { | ||
return &ConnResetRetryer{ | ||
baseRetryer: baseRetryer, | ||
} | ||
} | ||
|
||
type ConnResetRetryer struct { | ||
baseRetryer request.Retryer | ||
} | ||
|
||
func (r ConnResetRetryer) ShouldRetry(req *request.Request) bool { | ||
if req.Error != nil && strings.Contains(req.Error.Error(), "connection reset by peer") { | ||
return true | ||
} | ||
|
||
return r.baseRetryer.ShouldRetry(req) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters