mirror of
https://github.com/Swatinem/rust-cache.git
synced 2024-11-23 06:16:07 +08:00
fix: cache restore failures (#136)
Fix cache restore failures to to upstream bug. Fixes #119
This commit is contained in:
parent
127a0e9568
commit
5e9fae966f
5
dist/restore/index.js
vendored
5
dist/restore/index.js
vendored
@ -60403,7 +60403,10 @@ async function run() {
|
||||
lib_core.saveState(config_STATE_BINS, JSON.stringify([...bins]));
|
||||
lib_core.info(`... Restoring cache ...`);
|
||||
const key = config.cacheKey;
|
||||
const restoreKey = await cache.restoreCache(config.cachePaths, key, [config.restoreKey]);
|
||||
// Pass a copy of cachePaths to avoid mutating the original array as reported by:
|
||||
// https://github.com/actions/toolkit/pull/1378
|
||||
// TODO: remove this once the underlying bug is fixed.
|
||||
const restoreKey = await cache.restoreCache(config.cachePaths.slice(), key, [config.restoreKey]);
|
||||
if (restoreKey) {
|
||||
lib_core.info(`Restored from cache key "${restoreKey}".`);
|
||||
lib_core.saveState(STATE_KEY, restoreKey);
|
||||
|
5
dist/save/index.js
vendored
5
dist/save/index.js
vendored
@ -60434,7 +60434,10 @@ async function run() {
|
||||
core.info(`[warning] ${e.stack}`);
|
||||
}
|
||||
core.info(`... Saving cache ...`);
|
||||
await cache.saveCache(config.cachePaths, config.cacheKey);
|
||||
// Pass a copy of cachePaths to avoid mutating the original array as reported by:
|
||||
// https://github.com/actions/toolkit/pull/1378
|
||||
// TODO: remove this once the underlying bug is fixed.
|
||||
await cache.saveCache(config.cachePaths.slice(), config.cacheKey);
|
||||
}
|
||||
catch (e) {
|
||||
core.info(`[warning] ${e.stack}`);
|
||||
|
@ -34,7 +34,10 @@ async function run() {
|
||||
|
||||
core.info(`... Restoring cache ...`);
|
||||
const key = config.cacheKey;
|
||||
const restoreKey = await cache.restoreCache(config.cachePaths, key, [config.restoreKey]);
|
||||
// Pass a copy of cachePaths to avoid mutating the original array as reported by:
|
||||
// https://github.com/actions/toolkit/pull/1378
|
||||
// TODO: remove this once the underlying bug is fixed.
|
||||
const restoreKey = await cache.restoreCache(config.cachePaths.slice(), key, [config.restoreKey]);
|
||||
if (restoreKey) {
|
||||
core.info(`Restored from cache key "${restoreKey}".`);
|
||||
core.saveState(STATE_KEY, restoreKey);
|
||||
|
@ -66,7 +66,10 @@ async function run() {
|
||||
}
|
||||
|
||||
core.info(`... Saving cache ...`);
|
||||
await cache.saveCache(config.cachePaths, config.cacheKey);
|
||||
// Pass a copy of cachePaths to avoid mutating the original array as reported by:
|
||||
// https://github.com/actions/toolkit/pull/1378
|
||||
// TODO: remove this once the underlying bug is fixed.
|
||||
await cache.saveCache(config.cachePaths.slice(), config.cacheKey);
|
||||
} catch (e) {
|
||||
core.info(`[warning] ${(e as any).stack}`);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user