mirror of
https://github.com/rclone/rclone
synced 2025-01-27 10:28:38 +01:00
dropbox: make batcher retry all errors so it doesn't exit early
See: https://forum.rclone.org/t/dropbox-too-many-requests-or-write-operations-trying-again-in-15-seconds/23316/18
This commit is contained in:
parent
4a4aca4da7
commit
5ee646f264
@ -147,19 +147,23 @@ func (b *batcher) finishBatchJobStatus(ctx context.Context, launchBatchStatus *f
|
|||||||
return shouldRetry(ctx, err)
|
return shouldRetry(ctx, err)
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "wait for batch completion: check failed")
|
fs.Debugf(b.f, "Wait for batch: sleeping for %v after error: %v: try %d/%d", sleepTime, err, try, maxTries)
|
||||||
|
} else {
|
||||||
|
if batchStatus.Tag == "complete" {
|
||||||
|
return batchStatus.Complete, nil
|
||||||
|
}
|
||||||
|
fs.Debugf(b.f, "Wait for batch: sleeping for %v after status: %q: try %d/%d", sleepTime, batchStatus.Tag, try, maxTries)
|
||||||
}
|
}
|
||||||
if batchStatus.Tag == "complete" {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
fs.Debugf(b.f, "Sleeping for %v to wait for batch to complete: %q: try %d/%d", sleepTime, batchStatus.Tag, try, maxTries)
|
|
||||||
time.Sleep(sleepTime)
|
time.Sleep(sleepTime)
|
||||||
sleepTime *= 2
|
sleepTime *= 2
|
||||||
if sleepTime > time.Second {
|
if sleepTime > time.Second {
|
||||||
sleepTime = time.Second
|
sleepTime = time.Second
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return batchStatus.Complete, nil
|
if err == nil {
|
||||||
|
err = errors.New("batch didn't complete")
|
||||||
|
}
|
||||||
|
return nil, errors.Wrapf(err, "wait for batch failed after %d tries", maxTries)
|
||||||
}
|
}
|
||||||
|
|
||||||
// commit a batch
|
// commit a batch
|
||||||
|
Loading…
Reference in New Issue
Block a user