8000 feat: purge build cache by Bikappa · Pull Request #2033 · arduino/arduino-cli · GitHub
[go: up one dir, main page]

Skip to content

feat: purge build cache #2033

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: cache age check
  • Loading branch information
Luca Bianconi committed Feb 3, 2023
commit 6ac7fce2f1671aca8b9da5f5b74d002c5edfcd0d
2 changes: 1 addition & 1 deletion buildcache/build_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func New(baseDir *paths.Path) *BuildCache {
}

func removeIfExpired(dir *paths.Path, ttl time.Duration) {
fileInfo, err := dir.Join().Stat()
fileInfo, err := dir.Join(lastUsedFileName).Stat()
if err != nil {
return
}
Expand Down
8374
6 changes: 2 additions & 4 deletions buildcache/build_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ func TestPurge(t *testing.T) {

New(dirToPurge).Purge(ttl)

files, err := dirToPurge.Join("fresh").Stat()
require.Nil(t, err)
require.True(t, files.IsDir())
require.True(t, dirToPurge.Exist())
require.False(t, dirToPurge.Join("old").Exist())
require.True(t, dirToPurge.Join("fresh").Exist())
}
0