diff --git a/core.go b/core.go index b383e6d..4d7a24c 100644 --- a/core.go +++ b/core.go @@ -380,6 +380,10 @@ var holidayCache cache var holidayCacheLock sync.Mutex func GetHolidaysDataWithCache() ([]HolidaysItem, error) { + + holidayCacheLock.Lock() + defer holidayCacheLock.Unlock() + if holidayCache.IsExpired() || holidayCache.GetData() == "" { data, err := GetHolidaysData() if err != nil {