diff --git a/actions/feed.go b/actions/feed.go index d5cd422..6a70397 100644 --- a/actions/feed.go +++ b/actions/feed.go @@ -34,6 +34,10 @@ func InitFeed() { } } +func ClearCache() { + postFeedCache.ClearExpired() +} + func isCacheExpired(c *gin.Context, lastTime time.Time) bool { eTag := helper.StringMd5(lastTime.Format(tmp)) since := c.Request.Header.Get("If-Modified-Since") diff --git a/main.go b/main.go index 5324184..6d9b4d3 100644 --- a/main.go +++ b/main.go @@ -44,6 +44,7 @@ func cronClearCache() { case <-t.C: common.ClearCache() plugins.ClearDigestCache() + actions.ClearCache() } } }