add useCache option for cloud functions

commit-id:8d771c77
This commit is contained in:
justinschuldt 2022-02-23 12:01:57 -06:00 committed by Justin Schuldt
parent e582c872ec
commit d6d04f61bb
1 changed files with 13 additions and 0 deletions

View File

@ -462,6 +462,19 @@ func createCachePrefix(prefix string) string {
return cachePrefix return cachePrefix
} }
// useCache allows overriding the cache for a given day.
// This is useful for debugging, to generate fresh data
func useCache(date string) bool {
skipDates := map[string]bool{
// for example, add to skip:
// "2022-02-01": true,
}
if _, ok := skipDates[date]; ok {
return false
}
return true
}
var mux = newMux() var mux = newMux()
// Entry is the cloud function entry point // Entry is the cloud function entry point