From 7677214099aba141fc7a4b772e9b3df7d6e490e9 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 26 Dec 2023 23:41:01 -0800 Subject: [PATCH] no directory --- bazel_disk_cache_cleaner/bazel_disk_cache_cleaner.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bazel_disk_cache_cleaner/bazel_disk_cache_cleaner.go b/bazel_disk_cache_cleaner/bazel_disk_cache_cleaner.go index 92a7c0b..2c248f0 100644 --- a/bazel_disk_cache_cleaner/bazel_disk_cache_cleaner.go +++ b/bazel_disk_cache_cleaner/bazel_disk_cache_cleaner.go @@ -61,7 +61,7 @@ func main() { } } timeKeepFilesAccessedDays := time.Duration(KeepFilesAccessedDays) * 24 * time.Hour - if accessTime.Add(timeKeepFilesAccessedDays).Before(time.Now()) && path != BazelCacheDir { + if accessTime.Add(timeKeepFilesAccessedDays).Before(time.Now()) && path != BazelCacheDir && !info.IsDir() { // Check if Access time is greater than desired days to keep // don't delete cache dir, otherwise you'll have to purge bazel cache completely fileList = append(fileList, path)