Skip to content

Commit ae0f68d

Browse files
author
Tim Middleton
authored
Minor update to exclude special caches (#251)
1 parent cefa76e commit ae0f68d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

pkg/cmd/cache.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ func formatCachesSummary(serviceList []string, dataFetcher fetcher.Fetcher) (str
923923
if ignoreSpecialCaches {
924924
finalList := make([]config.CacheSummaryDetail, 0)
925925
for _, v := range allCachesSummary {
926-
if !strings.Contains(v.CacheName, "$") {
926+
if !isSpecialCache(v.CacheName) {
927927
finalList = append(finalList, v)
928928
}
929929
}
@@ -936,6 +936,13 @@ func formatCachesSummary(serviceList []string, dataFetcher fetcher.Fetcher) (str
936936
return value, err
937937
}
938938

939+
var specialCacheNames = []string{"executor-assignments", "executor-tasks", "executor-executors"}
940+
941+
// isSpecialCache returns true if a cache is a "special" or internal cache
942+
func isSpecialCache(cacheName string) bool {
943+
return strings.Contains(cacheName, "$") || utils.SliceContains(specialCacheNames, cacheName)
944+
}
945+
939946
// formatViewCachesSummary returns the formatted view caches for the service list.
940947
func formatViewCachesSummary(serviceList []string, dataFetcher fetcher.Fetcher) (string, error) {
941948
allCachesSummary, err := getViewCaches(serviceList, dataFetcher)

0 commit comments

Comments
 (0)