mirror of
https://github.com/Swatinem/rust-cache
synced 2025-11-08 00:15:06 +00:00
log individual timings
This commit is contained in:
parent
a6b59fa340
commit
271ff4b692
2 changed files with 18 additions and 10 deletions
14
src/save.ts
14
src/save.ts
|
|
@ -38,16 +38,20 @@ async function run() {
|
|||
core.info(`${name} up-to-date.`);
|
||||
continue;
|
||||
}
|
||||
const start = Date.now();
|
||||
core.startGroup(`Saving ${name}…`);
|
||||
core.info(`Saving path "${path}".`);
|
||||
core.info(`Using key "${key}".`);
|
||||
try {
|
||||
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 {
|
||||
core.endGroup();
|
||||
}
|
||||
const duration = Math.round((Date.now() - start) / 1000);
|
||||
if (duration) {
|
||||
core.info(`Took ${duration}s.`);
|
||||
}
|
||||
core.endGroup();
|
||||
}
|
||||
} catch (e) {
|
||||
core.info(`[warning] ${e.message}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue