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 {
// NewDriver 从存储策略初始化新的Driver实例
func NewDriver(policy *model.Policy) (driver.Handler, error) {
client, err := NewClient(policy)
if policy.OptionsSerialized.ChunkSize == 0 {
policy.OptionsSerialized.ChunkSize = 50 << 20 // 50MB
}
return Driver{
Policy: policy,
Client: client,