mirror of https://github.com/Xhofe/alist
🔥 Optimize delete cache
parent
ddf6a4955f
commit
6dd8102a82
|
@ -36,7 +36,9 @@ func DeleteFiles(c *gin.Context) {
|
||||||
}
|
}
|
||||||
err = operate.Delete(driver, account, path_, clearCache)
|
err = operate.Delete(driver, account, path_, clearCache)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = base.DeleteCache(utils.Dir(path_), account)
|
if i == 0 {
|
||||||
|
_ = base.DeleteCache(utils.Dir(path_), account)
|
||||||
|
}
|
||||||
common.ErrorResp(c, err, 500)
|
common.ErrorResp(c, err, 500)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,9 @@ func UploadFiles(c *gin.Context) {
|
||||||
}
|
}
|
||||||
err = operate.Upload(driver, account, &fileStream, clearCache)
|
err = operate.Upload(driver, account, &fileStream, clearCache)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
_ = base.DeleteCache(path_, account)
|
if i != 0 {
|
||||||
|
_ = base.DeleteCache(path_, account)
|
||||||
|
}
|
||||||
common.ErrorResp(c, err, 500)
|
common.ErrorResp(c, err, 500)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue