From 2bada6fc51fb233f49c1d2ea40950627e345747c Mon Sep 17 00:00:00 2001 From: u Date: Fri, 21 Apr 2023 11:45:08 +0800 Subject: [PATCH] =?UTF-8?q?GIT=E6=8F=90=E4=BA=A4=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### 重构:改进节日数据检索的缓存机制 - 检查节日缓存中的空数据 - 改善节日数据检索的缓存机制 Signed-off-by: u ### --- core.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core.go b/core.go index 110af5a..07c08f3 100644 --- a/core.go +++ b/core.go @@ -380,7 +380,7 @@ var holidayCache *cache var holidayCacheLock sync.Mutex func GetHolidaysDataWithCache() ([]HolidaysItem, error) { - if holidayCache.IsExpired() { + if holidayCache.IsExpired() || holidayCache.GetData() == "" { data, err := GetHolidaysData() if err != nil { return nil, err