Skip to content

Commit

Permalink
cleanup improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
mryzhov committed Mar 25, 2024
1 parent bf39076 commit c5cfb00
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 8 deletions.
12 changes: 10 additions & 2 deletions .github/actions/cache/dist/cleanup-only/index.js

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

12 changes: 10 additions & 2 deletions .github/actions/cache/dist/save-only/index.js

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

12 changes: 10 additions & 2 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.

12 changes: 10 additions & 2 deletions .github/actions/cache/src/cleanupImpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,16 @@ async function cleanUp() {

if (fileStats.isFile() && fileStats.atime < minAccessDateAgo) {
core.info(`Removing file: ${filePath}`)
fs.unlinkSync(filePath)
totalSize -= fileStats.size
// fs.unlink(filePath)
fs.unlink(filePath, err => {
if (err) {
core.warning(`Could not remove file: ${filePath}: ${err}`)
} else {
core.info(`{filePath} removed successfully`)
totalSize -= fileStats.size
}
})
// totalSize -= fileStats.size
}

if (totalSize <= maxCacheSizeInBytes) {
Expand Down

0 comments on commit c5cfb00

Please sign in to comment.