mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-08 11:20:27 +08:00
优化代码
This commit is contained in:
@@ -770,6 +770,7 @@ func (this *FileStorage) CleanAll() error {
|
|||||||
var dirNameReg = regexp.MustCompile(`^[0-9a-f]{2}$`)
|
var dirNameReg = regexp.MustCompile(`^[0-9a-f]{2}$`)
|
||||||
for _, rootDir := range rootDirs {
|
for _, rootDir := range rootDirs {
|
||||||
var dir = rootDir + "/p" + types.String(this.policy.Id)
|
var dir = rootDir + "/p" + types.String(this.policy.Id)
|
||||||
|
err = func(dir string) error {
|
||||||
fp, err := os.Open(dir)
|
fp, err := os.Open(dir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -815,6 +816,12 @@ func (this *FileStorage) CleanAll() error {
|
|||||||
remotelogs.Warn("CACHE", "delete '*-deleted' dirs failed: "+err.Error())
|
remotelogs.Warn("CACHE", "delete '*-deleted' dirs failed: "+err.Error())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}(dir)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user