Don't follow symlinks when hashing cache files (#10)
Fixes performance regression in 2eb83dc753
This commit is contained in:
parent
1cc0c15a80
commit
c033bc050f
3 changed files with 13 additions and 3 deletions
7
dist/post/index.js
vendored
7
dist/post/index.js
vendored
|
|
@ -95859,7 +95859,12 @@ async function saveCache(cacheConfig) {
|
||||||
try {
|
try {
|
||||||
core.startGroup(`Save cache for ${cacheConfig.name}`)
|
core.startGroup(`Save cache for ${cacheConfig.name}`)
|
||||||
const paths = cacheConfig.paths
|
const paths = cacheConfig.paths
|
||||||
const hash = await glob.hashFiles(cacheConfig.files.join('\n'))
|
const hash = await glob.hashFiles(
|
||||||
|
cacheConfig.files.join('\n'),
|
||||||
|
undefined,
|
||||||
|
// We don't want to follow symlinks as it's extremely slow on macOS.
|
||||||
|
{ followSymbolicLinks: false }
|
||||||
|
)
|
||||||
const key = `${config.baseCacheKey}-${cacheConfig.name}-${hash}`
|
const key = `${config.baseCacheKey}-${cacheConfig.name}-${hash}`
|
||||||
console.log(`Attempting to save ${paths} cache to ${key}`)
|
console.log(`Attempting to save ${paths} cache to ${key}`)
|
||||||
await cache.saveCache(paths, key)
|
await cache.saveCache(paths, key)
|
||||||
|
|
|
||||||
2
dist/post/index.js.map
vendored
2
dist/post/index.js.map
vendored
File diff suppressed because one or more lines are too long
7
post.js
7
post.js
|
|
@ -72,7 +72,12 @@ async function saveCache(cacheConfig) {
|
||||||
try {
|
try {
|
||||||
core.startGroup(`Save cache for ${cacheConfig.name}`)
|
core.startGroup(`Save cache for ${cacheConfig.name}`)
|
||||||
const paths = cacheConfig.paths
|
const paths = cacheConfig.paths
|
||||||
const hash = await glob.hashFiles(cacheConfig.files.join('\n'))
|
const hash = await glob.hashFiles(
|
||||||
|
cacheConfig.files.join('\n'),
|
||||||
|
undefined,
|
||||||
|
// We don't want to follow symlinks as it's extremely slow on macOS.
|
||||||
|
{ followSymbolicLinks: false }
|
||||||
|
)
|
||||||
const key = `${config.baseCacheKey}-${cacheConfig.name}-${hash}`
|
const key = `${config.baseCacheKey}-${cacheConfig.name}-${hash}`
|
||||||
console.log(`Attempting to save ${paths} cache to ${key}`)
|
console.log(`Attempting to save ${paths} cache to ${key}`)
|
||||||
await cache.saveCache(paths, key)
|
await cache.saveCache(paths, key)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue