From 6704b5b48664cbbdbafd1fc87edbc3efeaeac1eb Mon Sep 17 00:00:00 2001 From: xing Date: Fri, 7 Oct 2022 23:16:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=85=E7=90=86=E7=BC=93=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- actions/feed.go | 4 ++++ main.go | 1 + 2 files changed, 5 insertions(+) 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() } } }