From ae40dc361e5301b0390c8cba56d1b9775dada628 Mon Sep 17 00:00:00 2001 From: Raphael Vigee Date: Mon, 22 Apr 2024 14:57:46 +0100 Subject: [PATCH] filter out disabled caches --- rcache/cache_selection.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rcache/cache_selection.go b/rcache/cache_selection.go index 505d39e2..2f4134ac 100644 --- a/rcache/cache_selection.go +++ b/rcache/cache_selection.go @@ -62,6 +62,10 @@ func (c orderCacheContainer) calculateLatency(ctx context.Context) (time.Duratio } func orderCaches(ctx context.Context, caches []CacheConfig) []CacheConfig { + caches = ads.Filter(caches, func(cc CacheConfig) bool { + return cc.Read || cc.Write + }) + if len(caches) <= 1 { return caches }