清理缓存

This commit is contained in:
xing 2022-10-07 23:16:25 +08:00
parent fd3d8bc32e
commit 6704b5b486
2 changed files with 5 additions and 0 deletions

View File

@ -34,6 +34,10 @@ func InitFeed() {
} }
} }
func ClearCache() {
postFeedCache.ClearExpired()
}
func isCacheExpired(c *gin.Context, lastTime time.Time) bool { func isCacheExpired(c *gin.Context, lastTime time.Time) bool {
eTag := helper.StringMd5(lastTime.Format(tmp)) eTag := helper.StringMd5(lastTime.Format(tmp))
since := c.Request.Header.Get("If-Modified-Since") since := c.Request.Header.Get("If-Modified-Since")

View File

@ -44,6 +44,7 @@ func cronClearCache() {
case <-t.C: case <-t.C:
common.ClearCache() common.ClearCache()
plugins.ClearDigestCache() plugins.ClearDigestCache()
actions.ClearCache()
} }
} }
} }