putio: handle rate limit errors
For rate limit errors, "x-ratelimit-reset" header is now respected.
This commit is contained in:
parent
887cccb2c1
commit
6ea26b508a
5 changed files with 36 additions and 5 deletions
|
@ -302,8 +302,8 @@ func (f *Fs) createUpload(ctx context.Context, name string, size int64, parentID
|
|||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
if resp.StatusCode != 201 {
|
||||
return false, fmt.Errorf("unexpected status code from upload create: %d", resp.StatusCode)
|
||||
if err := checkStatusCode(resp, 201); err != nil {
|
||||
return shouldRetry(ctx, err)
|
||||
}
|
||||
location = resp.Header.Get("location")
|
||||
if location == "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue