Skip to content

Commit

Permalink
use sync methods
Browse files Browse the repository at this point in the history
  • Loading branch information
mryzhov committed Mar 20, 2024
1 parent f6f6378 commit 44b9730
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/actions/cache/dist/restore/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .github/actions/cache/dist/save/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .github/actions/cache/src/saveImpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ async function cleanUp() {
for (let i = files.length - 1; i >= 0; i--) {
var file = files[i]
const filePath = path.join(directory, file)
const fileStats = await stat(filePath)
const fileStats = fs.statSync(filePath)

if (fileStats.isFile() && fileStats.ctime < oneWeekAgo) {
console.log(`Removing file: ${filePath}`)
await unlink(filePath)
fs.unlinkSync(filePath)
totalSize -= fileStats.size
}

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/cache/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async function calculateTotalSize(dir, files) {

for (const file of files) {
const filePath = path.join(dir, file)
const fileStats = await stat(filePath)
const fileStats = fs.statSync(filePath)

if (fileStats.isFile()) {
totalSize += fileStats.size
Expand Down

0 comments on commit 44b9730

Please sign in to comment.