hashing driven enhancement for cache
parent
00937a75df
commit
7d106a632d
|
|
@ -568,18 +568,15 @@ class Caching {
|
|||
if (!fs_1.default.existsSync(destinationFolder)) {
|
||||
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`mkdir -p ${destinationFolder}`);
|
||||
}
|
||||
const latest = yield (yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`ls -t "${cacheFolder}" | grep .zip$ | head -1`)).replace(/\n/g, ``);
|
||||
const latestInBranch = yield (yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`ls -t "${cacheFolder}" | grep .zip$ | head -1`)).replace(/\n/g, ``);
|
||||
process.chdir(cacheFolder);
|
||||
let cacheSelection;
|
||||
if (__1.Input.cloudRunnerTests) {
|
||||
cloud_runner_logger_1.default.log(yield lfs_hashing_1.LFSHashing.hashAllFiles(destinationFolder));
|
||||
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`tree ${cacheFolder}`);
|
||||
}
|
||||
if (cacheKey !== ``) {
|
||||
cacheSelection = fs_1.default.existsSync(cacheKey) ? cacheKey : latest;
|
||||
}
|
||||
else {
|
||||
cacheSelection = latest;
|
||||
const cacheSelection = cacheKey !== `` && fs_1.default.existsSync(cacheKey) ? cacheKey : latestInBranch;
|
||||
if (__1.Input.cloudRunnerTests) {
|
||||
yield cloud_runner_agent_system_1.CloudRunnerAgentSystem.Run(`cache key ${cacheKey} selection ${cacheSelection}`);
|
||||
}
|
||||
if (fs_1.default.existsSync(cacheSelection)) {
|
||||
if (__1.Input.cloudRunnerTests) {
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -47,24 +47,23 @@ export class Caching {
|
|||
await CloudRunnerAgentSystem.Run(`mkdir -p ${destinationFolder}`);
|
||||
}
|
||||
|
||||
const latest = await (await CloudRunnerAgentSystem.Run(`ls -t "${cacheFolder}" | grep .zip$ | head -1`)).replace(
|
||||
/\n/g,
|
||||
``,
|
||||
);
|
||||
const latestInBranch = await (
|
||||
await CloudRunnerAgentSystem.Run(`ls -t "${cacheFolder}" | grep .zip$ | head -1`)
|
||||
).replace(/\n/g, ``);
|
||||
|
||||
process.chdir(cacheFolder);
|
||||
let cacheSelection;
|
||||
|
||||
if (Input.cloudRunnerTests) {
|
||||
CloudRunnerLogger.log(await LFSHashing.hashAllFiles(destinationFolder));
|
||||
await CloudRunnerAgentSystem.Run(`tree ${cacheFolder}`);
|
||||
}
|
||||
|
||||
if (cacheKey !== ``) {
|
||||
cacheSelection = fs.existsSync(cacheKey) ? cacheKey : latest;
|
||||
} else {
|
||||
cacheSelection = latest;
|
||||
const cacheSelection = cacheKey !== `` && fs.existsSync(cacheKey) ? cacheKey : latestInBranch;
|
||||
|
||||
if (Input.cloudRunnerTests) {
|
||||
await CloudRunnerAgentSystem.Run(`cache key ${cacheKey} selection ${cacheSelection}`);
|
||||
}
|
||||
|
||||
if (fs.existsSync(cacheSelection)) {
|
||||
if (Input.cloudRunnerTests) {
|
||||
await CloudRunnerAgentSystem.Run(`tree ${destinationFolder}`);
|
||||
|
|
|
|||
Loading…
Reference in New Issue