fix: use default chunk size if it is set as 0

This commit is contained in:
HFO4
2022-04-19 19:41:03 +08:00
parent 3804efd792
commit 4f65d0e859
6 changed files with 20 additions and 1 deletions

View File

@@ -57,6 +57,10 @@ const (
)
func NewDriver(policy *model.Policy) (*Driver, error) {
if policy.OptionsSerialized.ChunkSize == 0 {
policy.OptionsSerialized.ChunkSize = 25 << 20 // 25 MB
}
driver := &Driver{
Policy: policy,
HTTPClient: request.NewClient(),