Skip to content

Fix slow cache restore on Windows #515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
move symlink check
Signed-off-by: Anton Troshin <anton@diagrid.io>
  • Loading branch information
antontroshin committed Nov 19, 2024
commit fd3fcb34ee39ab9729bba70e064c6c55cca83950
20 changes: 10 additions & 10 deletions src/installer.ts
Original file line number Diff line number Diff line change
@@ -239,16 +239,16 @@ async function cacheWindowsDir(
fs.mkdirSync(path.dirname(cachePath.actualPath), {recursive: true});
} else {
core.info(`Directory ${cachePath.actualPath} already exists`);
// make sure the link is pointing to the actual cache directory
const symlinkTarget = fs.readlinkSync(cachePath.defaultPath);
if (symlinkTarget !== "") {
core.info(`Found link ${cachePath.defaultPath} => ${symlinkTarget}`);
} else {
fs.symlinkSync(cachePath.actualPath, cachePath.defaultPath, 'junction');
core.info(
`Created link ${cachePath.defaultPath} => ${cachePath.actualPath}`
);
}
}
// make sure the link is pointing to the actual cache directory
const symlinkTarget = fs.readlinkSync(cachePath.defaultPath);
if (symlinkTarget !== "") {
core.info(`Found link ${cachePath.defaultPath} => ${symlinkTarget}`);
} else {
fs.symlinkSync(cachePath.actualPath, cachePath.defaultPath, 'junction');
core.info(
`Created link ${cachePath.defaultPath} => ${cachePath.actualPath}`
);
}
}