MCPcopy Index your code
hub / github.com/github/docs / getDiskCachePath

Function getDiskCachePath

lib/changelog.js:74–85  ·  view source on GitHub ↗
(prefix, feedUrl)

Source from the content-addressed store, hash-verified

72}
73
74function getDiskCachePath(prefix, feedUrl) {
75 // When in local development or in tests, use disk caching
76 if (process.env.NODE_ENV === 'test' || process.env.NODE_ENV === 'development') {
77 if (CHANGELOG_CACHE_FILE_PATH) {
78 return CHANGELOG_CACHE_FILE_PATH
79 }
80 const cacheKey = getChangelogCacheKey(prefix, feedUrl)
81 const date = new Date().toISOString().split('T')[0]
82 const fileName = `changelogcache-${cacheKey}-${date}.json`
83 return path.join(os.tmpdir(), fileName)
84 }
85}
86
87function getChangelogItemsFromCache(prefix, feedUrl) {
88 const cacheKey = getChangelogCacheKey(prefix, feedUrl)

Callers 2

setChangelogItemsCacheFunction · 0.85

Calls 1

getChangelogCacheKeyFunction · 0.85

Tested by

no test coverage detected