alist/server/controllers/cache.go

17 lines
289 B
Go
Raw Normal View History

2021-12-07 07:56:43 +00:00
package controllers
2021-11-01 14:42:24 +00:00
import (
"github.com/Xhofe/alist/conf"
2021-12-07 07:56:43 +00:00
"github.com/Xhofe/alist/server/common"
2021-11-13 07:53:26 +00:00
"github.com/gin-gonic/gin"
2021-11-01 14:42:24 +00:00
)
2021-11-13 07:53:26 +00:00
func ClearCache(c *gin.Context) {
2021-11-01 14:42:24 +00:00
err := conf.Cache.Clear(conf.Ctx)
if err != nil {
2021-12-07 07:56:43 +00:00
common.ErrorResp(c, err, 500)
2021-11-13 07:53:26 +00:00
} else {
2021-12-07 07:56:43 +00:00
common.SuccessResp(c)
2021-11-01 14:42:24 +00:00
}
2021-11-13 07:53:26 +00:00
}