forked from TrueCloudLab/rclone
box: make --box-commit-retries flag defaulting to 100 - Fixes #2054
Sometimes it takes many more commit retries than expected to commit a multipart file, so split this number into its own config variable and default it to 100 which should always be enough.
This commit is contained in:
parent
990919f268
commit
751bfd456f
3 changed files with 14 additions and 2 deletions
|
@ -88,6 +88,11 @@ func init() {
|
||||||
Help: "Cutoff for switching to multipart upload.",
|
Help: "Cutoff for switching to multipart upload.",
|
||||||
Default: fs.SizeSuffix(defaultUploadCutoff),
|
Default: fs.SizeSuffix(defaultUploadCutoff),
|
||||||
Advanced: true,
|
Advanced: true,
|
||||||
|
}, {
|
||||||
|
Name: "commit_retries",
|
||||||
|
Help: "Max number of times to try committing a multipart file.",
|
||||||
|
Default: 100,
|
||||||
|
Advanced: true,
|
||||||
}},
|
}},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -95,6 +100,7 @@ func init() {
|
||||||
// Options defines the configuration for this backend
|
// Options defines the configuration for this backend
|
||||||
type Options struct {
|
type Options struct {
|
||||||
UploadCutoff fs.SizeSuffix `config:"upload_cutoff"`
|
UploadCutoff fs.SizeSuffix `config:"upload_cutoff"`
|
||||||
|
CommitRetries int `config:"commit_retries"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fs represents a remote box
|
// Fs represents a remote box
|
||||||
|
|
|
@ -96,7 +96,9 @@ func (o *Object) commitUpload(SessionID string, parts []api.Part, modTime time.T
|
||||||
request.Attributes.ContentCreatedAt = api.Time(modTime)
|
request.Attributes.ContentCreatedAt = api.Time(modTime)
|
||||||
var body []byte
|
var body []byte
|
||||||
var resp *http.Response
|
var resp *http.Response
|
||||||
maxTries := fs.Config.LowLevelRetries
|
// For discussion of this value see:
|
||||||
|
// https://github.com/ncw/rclone/issues/2054
|
||||||
|
maxTries := o.fs.opt.CommitRetries
|
||||||
const defaultDelay = 10
|
const defaultDelay = 10
|
||||||
var tries int
|
var tries int
|
||||||
outer:
|
outer:
|
||||||
|
|
|
@ -227,6 +227,10 @@ system.
|
||||||
Cutoff for switching to chunked upload - must be >= 50MB. The default
|
Cutoff for switching to chunked upload - must be >= 50MB. The default
|
||||||
is 50MB.
|
is 50MB.
|
||||||
|
|
||||||
|
#### --box-commit-retries int ####
|
||||||
|
|
||||||
|
Max number of times to try committing a multipart file. (default 100)
|
||||||
|
|
||||||
### Limitations ###
|
### Limitations ###
|
||||||
|
|
||||||
Note that Box is case insensitive so you can't have a file called
|
Note that Box is case insensitive so you can't have a file called
|
||||||
|
|
Loading…
Add table
Reference in a new issue