mirror of
https://github.com/actions/cache.git
synced 2025-04-20 02:56:45 +00:00
Install custom actions/cache version - with lookupOnly support
This commit is contained in:
parent
627f0f41f6
commit
97a8c2bc1c
6 changed files with 48 additions and 12 deletions
11
dist/save/index.js
vendored
11
dist/save/index.js
vendored
|
@ -41865,7 +41865,8 @@ function getDownloadOptions(copy) {
|
|||
useAzureSdk: true,
|
||||
downloadConcurrency: 8,
|
||||
timeoutInMs: 30000,
|
||||
segmentTimeoutInMs: 3600000
|
||||
segmentTimeoutInMs: 3600000,
|
||||
lookupOnly: false
|
||||
};
|
||||
if (copy) {
|
||||
if (typeof copy.useAzureSdk === 'boolean') {
|
||||
|
@ -41880,6 +41881,9 @@ function getDownloadOptions(copy) {
|
|||
if (typeof copy.segmentTimeoutInMs === 'number') {
|
||||
result.segmentTimeoutInMs = copy.segmentTimeoutInMs;
|
||||
}
|
||||
if (typeof copy.lookupOnly === 'boolean') {
|
||||
result.lookupOnly = copy.lookupOnly;
|
||||
}
|
||||
}
|
||||
const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS'];
|
||||
if (segmentDownloadTimeoutMins &&
|
||||
|
@ -41892,6 +41896,7 @@ function getDownloadOptions(copy) {
|
|||
core.debug(`Request timeout (ms): ${result.timeoutInMs}`);
|
||||
core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`);
|
||||
core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`);
|
||||
core.debug(`Lookup only: ${result.lookupOnly}`);
|
||||
return result;
|
||||
}
|
||||
exports.getDownloadOptions = getDownloadOptions;
|
||||
|
@ -47369,6 +47374,10 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch
|
|||
// Cache not found
|
||||
return undefined;
|
||||
}
|
||||
if (options === null || options === void 0 ? void 0 : options.lookupOnly) {
|
||||
core.info('Lookup only - skipping download');
|
||||
return cacheEntry.cacheKey;
|
||||
}
|
||||
archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));
|
||||
core.debug(`Archive Path: ${archivePath}`);
|
||||
// Download the cache from the cache entry
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue