mirror of
https://github.com/Swatinem/rust-cache
synced 2025-07-31 18:33:20 +00:00
fix paths for cache dir
This commit is contained in:
parent
b37d2821f8
commit
64b8867183
2 changed files with 28 additions and 19 deletions
23
dist/save/index.js
vendored
23
dist/save/index.js
vendored
|
@ -87370,14 +87370,20 @@ async function run() {
|
||||||
// Save the incremental cache before we delete it
|
// Save the incremental cache before we delete it
|
||||||
if (config.incremental) {
|
if (config.incremental) {
|
||||||
core.info(`... Saving incremental cache ...`);
|
core.info(`... Saving incremental cache ...`);
|
||||||
core.debug(`paths include ${config.incrementalPaths} with key ${config.incrementalKey}`);
|
try {
|
||||||
for (const paths of config.incrementalPaths) {
|
core.debug(`paths include ${config.incrementalPaths} with key ${config.incrementalKey}`);
|
||||||
await saveIncrementalDirs(paths);
|
for (const paths of config.incrementalPaths) {
|
||||||
|
await saveIncrementalDirs(paths);
|
||||||
|
}
|
||||||
|
await cacheProvider.cache.saveCache(config.incrementalPaths.slice(), config.incrementalKey);
|
||||||
|
for (const path of config.incrementalPaths) {
|
||||||
|
core.debug(` deleting ${path}`);
|
||||||
|
await (0,promises_.rm)(path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
await cacheProvider.cache.saveCache(config.incrementalPaths.slice(), config.incrementalKey);
|
catch (e) {
|
||||||
for (const path of config.incrementalPaths) {
|
core.debug(`Failed to save incremental cache`);
|
||||||
core.debug(` deleting ${path}`);
|
core.debug(`${e.stack}`);
|
||||||
await (0,promises_.rm)(path);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const allPackages = [];
|
const allPackages = [];
|
||||||
|
@ -87436,9 +87442,8 @@ async function macOsWorkaround() {
|
||||||
}
|
}
|
||||||
catch { }
|
catch { }
|
||||||
}
|
}
|
||||||
async function saveIncrementalDirs(profileDir) {
|
async function saveIncrementalDirs(incrementalDir) {
|
||||||
// Traverse the incremental folder recursively and collect the modified times in a map
|
// Traverse the incremental folder recursively and collect the modified times in a map
|
||||||
const incrementalDir = external_path_default().join(profileDir, "incremental");
|
|
||||||
const modifiedTimes = new Map();
|
const modifiedTimes = new Map();
|
||||||
const fillModifiedTimes = async (dir) => {
|
const fillModifiedTimes = async (dir) => {
|
||||||
const dirEntries = await external_fs_default().promises.opendir(dir);
|
const dirEntries = await external_fs_default().promises.opendir(dir);
|
||||||
|
|
24
src/save.ts
24
src/save.ts
|
@ -42,14 +42,19 @@ async function run() {
|
||||||
// Save the incremental cache before we delete it
|
// Save the incremental cache before we delete it
|
||||||
if (config.incremental) {
|
if (config.incremental) {
|
||||||
core.info(`... Saving incremental cache ...`);
|
core.info(`... Saving incremental cache ...`);
|
||||||
core.debug(`paths include ${config.incrementalPaths} with key ${config.incrementalKey}`);
|
try {
|
||||||
for (const paths of config.incrementalPaths) {
|
core.debug(`paths include ${config.incrementalPaths} with key ${config.incrementalKey}`);
|
||||||
await saveIncrementalDirs(paths);
|
for (const paths of config.incrementalPaths) {
|
||||||
}
|
await saveIncrementalDirs(paths);
|
||||||
await cacheProvider.cache.saveCache(config.incrementalPaths.slice(), config.incrementalKey);
|
}
|
||||||
for (const path of config.incrementalPaths) {
|
await cacheProvider.cache.saveCache(config.incrementalPaths.slice(), config.incrementalKey);
|
||||||
core.debug(` deleting ${path}`);
|
for (const path of config.incrementalPaths) {
|
||||||
await rm(path);
|
core.debug(` deleting ${path}`);
|
||||||
|
await rm(path);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
core.debug(`Failed to save incremental cache`);
|
||||||
|
core.debug(`${(e as any).stack}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,9 +117,8 @@ async function macOsWorkaround() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async function saveIncrementalDirs(profileDir: string) {
|
async function saveIncrementalDirs(incrementalDir: string) {
|
||||||
// Traverse the incremental folder recursively and collect the modified times in a map
|
// Traverse the incremental folder recursively and collect the modified times in a map
|
||||||
const incrementalDir = path.join(profileDir, "incremental");
|
|
||||||
const modifiedTimes = new Map<string, number>();
|
const modifiedTimes = new Map<string, number>();
|
||||||
const fillModifiedTimes = async (dir: string) => {
|
const fillModifiedTimes = async (dir: string) => {
|
||||||
const dirEntries = await fs.promises.opendir(dir);
|
const dirEntries = await fs.promises.opendir(dir);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue