3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2025-08-21 04:10:26 +00:00

cache the roots not the files

This commit is contained in:
Jonathan Kelley 2025-01-28 22:53:29 -08:00
parent 01addf7215
commit 6095cc4363
No known key found for this signature in database
GPG key ID: 1FBB50F7EB0A08BE
5 changed files with 60 additions and 24 deletions

View file

@ -87381,7 +87381,10 @@ async function run() {
const restoreJson = external_path_default().join(config_CARGO_HOME, "incremental-restore.json");
const restoreString = await external_fs_default().promises.readFile(restoreJson, "utf8");
const restoreData = JSON.parse(restoreString);
for (const [file, mtime] of Object.entries(restoreData)) {
const incrementalKey = await cacheProvider.cache.restoreCache(restoreData.roots, config.incrementalKey, [config.restoreKey], { lookupOnly });
lib_core.debug(`restoring incremental builds from ${incrementalKey}`);
for (const [file, mtime] of Object.entries(restoreData.times)) {
lib_core.debug(`restoring ${file} with mtime ${mtime}`);
await external_fs_default().promises.utimes(file, new Date(mtime), new Date(mtime));
}
}