Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
Platane committed Jan 12, 2024
1 parent be232b3 commit 15787c8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const put = async (key, paths) => {

return {
payloadSize:
(new Uint8Array(payload).length / 1024 / 1024).toFixed(2) + "Mb",
(new Uint8Array(payload).length / 1024 / 1024).toFixed(3) + "Mb",
};
} finally {
fs.rmSync(tmpDir, { recursive: true });
Expand Down Expand Up @@ -73,7 +73,7 @@ const get = async (key, paths) => {
return {
cacheHit: true,
payloadSize:
(new Uint8Array(payload).length / 1024 / 1024).toFixed(2) + "Mb",
(new Uint8Array(payload).length / 1024 / 1024).toFixed(3) + "Mb",
};
} finally {
fs.rmSync(tmpDir, { recursive: true });
Expand Down
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const paths = getInput("path")
const a = Date.now();
console.log("cache get", { key, paths });
get(key, paths).then((res) => {
console.log("cache get done", res, " in", a - Date.now(), "ms");
console.log("cache get done", res, " in", Date.now() - a, "ms");

if (!res.cacheHit) {
// save those to the state, to use in post step
Expand Down
2 changes: 1 addition & 1 deletion post.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if (key) {
console.log("cache put", { key, paths });

put(key, paths).then((res) => {
console.log("cache put done", res, " in", a - Date.now(), "ms");
console.log("cache put done", res, " in", Date.now() - a, "ms");
});
} else {
console.log("cache is already set");
Expand Down

0 comments on commit 15787c8

Please sign in to comment.