mirror of
https://github.com/Swatinem/rust-cache
synced 2025-11-08 08:25:05 +00:00
improve logging
This commit is contained in:
parent
8902a8fc6c
commit
cfcc373039
3 changed files with 32 additions and 14 deletions
14
src/save.ts
14
src/save.ts
|
|
@ -28,16 +28,16 @@ async function run() {
|
|||
delete (caches as any).cache;
|
||||
}
|
||||
|
||||
for (const [name, { path, key }] of Object.entries(caches)) {
|
||||
if (core.getState(name) === key) {
|
||||
core.info(`Cache for "${path}" up-to-date.`);
|
||||
for (const [type, { name, path, key }] of Object.entries(caches)) {
|
||||
if (core.getState(type) === key) {
|
||||
core.info(`${name} up-to-date.`);
|
||||
continue;
|
||||
}
|
||||
try {
|
||||
core.startGroup(`Saving "${path}" to cache key "${key}"…`);
|
||||
if (await cache.saveCache([path], key)) {
|
||||
core.info(`Saved "${path}" to cache key "${key}".`);
|
||||
}
|
||||
core.startGroup(`Saving ${name}…`);
|
||||
core.info(`Saving path "${path}".`);
|
||||
core.info(`Using key "${key}".`);
|
||||
await cache.saveCache([path], key);
|
||||
} catch (e) {
|
||||
core.info(`[warning] ${e.message}`);
|
||||
} finally {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue