提升缓存效率

This commit is contained in:
GoEdgeLab
2022-03-16 16:20:53 +08:00
parent 832fb355fa
commit a90baa69c7
6 changed files with 155 additions and 61 deletions

View File

@@ -205,12 +205,12 @@ func (this *FileStorage) Init() error {
return errors.New("[CACHE]cache storage dir can not be empty")
}
var list = NewFileList(Tea.Root + "/data/cache-index/p" + types.String(this.policy.Id))
var list = NewFileList(dir + "/p" + types.String(this.policy.Id) + "/.indexes")
err = list.Init()
if err != nil {
return err
}
list.(*FileList).SetOldDir(this.options.Dir + "/p" + types.String(this.policy.Id))
list.(*FileList).SetOldDir(dir + "/p" + types.String(this.policy.Id))
this.list = list
stat, err := list.Stat(func(hash string) bool {
return true