🔥 Optimize delete cache

pull/548/head
微凉 2022-01-11 23:45:12 +08:00
parent ddf6a4955f
commit 6dd8102a82
2 changed files with 6 additions and 2 deletions

View File

@ -36,7 +36,9 @@ func DeleteFiles(c *gin.Context) {
}
err = operate.Delete(driver, account, path_, clearCache)
if err != nil {
_ = base.DeleteCache(utils.Dir(path_), account)
if i == 0 {
_ = base.DeleteCache(utils.Dir(path_), account)
}
common.ErrorResp(c, err, 500)
return
}

View File

@ -55,7 +55,9 @@ func UploadFiles(c *gin.Context) {
}
err = operate.Upload(driver, account, &fileStream, clearCache)
if err != nil {
_ = base.DeleteCache(path_, account)
if i != 0 {
_ = base.DeleteCache(path_, account)
}
common.ErrorResp(c, err, 500)
return
}