mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Test: pkg/task
This commit is contained in:
@@ -75,10 +75,13 @@ func GetPolicyByID(ID interface{}) (Policy, error) {
|
||||
// AfterFind 找到存储策略后的钩子
|
||||
func (policy *Policy) AfterFind() (err error) {
|
||||
// 解析存储策略设置到OptionsSerialized
|
||||
err = json.Unmarshal([]byte(policy.Options), &policy.OptionsSerialized)
|
||||
if policy.OptionsSerialized.FileType == nil {
|
||||
policy.OptionsSerialized.FileType = []string{}
|
||||
if policy.Options != "" {
|
||||
err = json.Unmarshal([]byte(policy.Options), &policy.OptionsSerialized)
|
||||
if policy.OptionsSerialized.FileType == nil {
|
||||
policy.OptionsSerialized.FileType = []string{}
|
||||
}
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user