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

@@ -77,6 +77,9 @@ func addDefaultPolicy() {
DirNameRule: "uploads/{uid}/{path}",
FileNameRule: "{uid}_{randomkey8}_{originname}",
IsOriginLinkEnable: false,
OptionsSerialized: PolicyOption{
ChunkSize: 25 << 20, // 25MB
},
}
if err := DB.Create(&defaultPolicy).Error; err != nil {
util.Log().Panic("无法创建初始存储策略, %s", err)