Skip to content

Commit 291a30e

Browse files
committed
Nit
Signed-off-by: Justin Jung <[email protected]>
1 parent a92e069 commit 291a30e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

pkg/querier/tripperware/queryrange/results_cache.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"flag"
66
"fmt"
77
"net/http"
8+
"slices"
89
"sort"
910
"strings"
1011
"time"
@@ -297,12 +298,7 @@ func (s resultsCache) shouldCacheResponse(ctx context.Context, req tripperware.R
297298
return false
298299
}
299300
if res, ok := r.(*tripperware.PrometheusResponse); ok {
300-
partialDataErr := partialdata.ErrPartialData
301-
for _, warning := range res.Warnings {
302-
if warning == partialDataErr.Error() {
303-
return false
304-
}
305-
}
301+
return !slices.Contains(res.Warnings, partialdata.ErrPartialData.Error())
306302
}
307303

308304
return true

0 commit comments

Comments
 (0)