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

@@ -30,6 +30,10 @@ type Driver struct {
}
func NewDriver(policy *model.Policy) *Driver {
if policy.OptionsSerialized.ChunkSize == 0 {
policy.OptionsSerialized.ChunkSize = 25 << 20 // 25 MB
}
mac := qbox.NewMac(policy.AccessKey, policy.SecretKey)
cfg := &storage.Config{UseHTTPS: true}
return &Driver{