去除缓存

This commit is contained in:
微凉
2021-03-07 21:02:56 +08:00
parent 443067b80f
commit b677d6ad21
19 changed files with 162 additions and 351 deletions

View File

@ -11,22 +11,6 @@ func Info(c *gin.Context) {
c.JSON(200, DataResponse(conf.Conf.Info))
}
// handle refresh_cache request
func RefreshCache(c *gin.Context) {
password := c.Param("password")
if conf.Conf.Cache.Enable {
if password == conf.Conf.Cache.RefreshPassword {
conf.Cache.Flush()
c.JSON(200, MetaResponse(200, "flush success."))
return
}
c.JSON(200, MetaResponse(401, "wrong password."))
return
}
c.JSON(200, MetaResponse(400, "disabled cache."))
return
}
// rebuild tree
func RebuildTree(c *gin.Context) {
if err := models.Clear(); err != nil {