Retry when we get a "500 Internal server error".

It seems like this happens randomly, and retrying works fine for that.
This commit is contained in:
Klaus Post 2015-09-12 22:48:48 +02:00 committed by Nick Craig-Wood
parent f1226f19b2
commit 6ac7145d2d

View file

@ -129,10 +129,14 @@ func shouldRetry(resp *http.Response, err error) (bool, error) {
if err != nil && resp != nil && resp.StatusCode == 429 { if err != nil && resp != nil && resp.StatusCode == 429 {
return true, err return true, err
} }
// Retry on occasional 500 Internal Server Error
if err != nil && resp != nil && resp.StatusCode == 500 {
return true, err
}
return false, err return false, err
} }
// NewFs contstructs an FsAcd from the path, container:path // NewFs constructs an FsAcd from the path, container:path
func NewFs(name, root string) (fs.Fs, error) { func NewFs(name, root string) (fs.Fs, error) {
root = parsePath(root) root = parsePath(root)
oAuthClient, err := oauthutil.NewClient(name, acdConfig) oAuthClient, err := oauthutil.NewClient(name, acdConfig)