From 3298677878a07641116930c75ddceaf3a0828a3b Mon Sep 17 00:00:00 2001 From: Gitea Actions Date: Wed, 30 Apr 2025 15:23:49 +0000 Subject: [PATCH] Deploy version 1.0.2 --- dist/index.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/dist/index.js b/dist/index.js index 04298ea..b85ec9a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -26198,8 +26198,9 @@ function formatSize(bytes) { } return `${bytes.toFixed(2)} ${units[i2]}`; } -function formatSpeed(bytes, seconds) { - if (seconds <= 0) return "\u221E"; +function formatSpeed(bytes, ms) { + if (ms <= 0) return "\u221E"; + const seconds = ms / 1e3; const speedBytesPerSec = bytes / seconds; const units = ["B/s", "KiB/s", "MiB/s", "GiB/s"]; let i2 = 0; @@ -26277,7 +26278,6 @@ async function downloadCache(options, owner, repo, key, destinationPath) { const endTime = Date.now(); const duration = endTime - startTime; const size = fs2.statSync(destinationPath).size; - const speedMBs = size / 1024 / 1024 / duration; console.log(`\u2705 Download completed`); console.log(`\u{1F4E6} Size: ${formatSize(size)}`); console.log(`\u23F1 Duration: ${formatDuration(duration)}`); @@ -26329,7 +26329,7 @@ async function extractCompressedTar(archivePath, extractTo = "/") { shell: "/bin/bash" }); const endTime = Date.now(); - const duration = (endTime - startTime) / 1e3; + const duration = endTime - startTime; const size = fs3.statSync(archivePath).size; const speedMBs = size / 1024 / 1024 / duration; console.log(`\u2705 Extraction completed`); @@ -26353,9 +26353,9 @@ async function saveCache(key, paths, cmprss_lvl = 3) { archivePath ); const endTime = Date.now(); - const durationSeconds = ((endTime - startTime) / 1e3).toFixed(2); + const duration = endTime - startTime; core.info( - `\u2705 Cache saved successfully (${formatSize(archiveSize)}, ${durationSeconds} s) + `\u2705 Cache saved successfully (${formatSize(archiveSize)}, ${formatDuration(duration)}) ` ); } @@ -26382,9 +26382,11 @@ async function restoreCache(key) { const archiveSize = fs5.statSync(zstPath).size; await extractCompressedTar(zstPath); const endTime = Date.now(); - const durationSeconds = ((endTime - startTime) / 1e3).toFixed(2); + const durationSeconds = (endTime - startTime) / 1e3; core2.info( - `\u2705 Cache restored successfully (${formatSize(archiveSize)}, ${durationSeconds} s)` + ` +\u2705 Cache restored successfully (${formatSize(archiveSize)}, ${formatDuration(durationSeconds)}) +` ); return true; }