diff --git a/pkg/client/query/cache/config.go b/pkg/client/query/cache/config.go index 3881bbf5e..77fae86b3 100644 --- a/pkg/client/query/cache/config.go +++ b/pkg/client/query/cache/config.go @@ -67,10 +67,10 @@ func (cfg *queryCacheConfig) Validate() error { // WithHistoricalMode enables historical caching with the given maxVersionAge // configuration; if 0, no historical pruning is performed. -func WithHistoricalMode(numRetainedVersions int64) QueryCacheOptionFn { +func WithHistoricalMode(maxVersionAge int64) QueryCacheOptionFn { return func(cfg *queryCacheConfig) { cfg.historical = true - cfg.maxVersionAge = numRetainedVersions + cfg.maxVersionAge = maxVersionAge } } diff --git a/pkg/client/query/options.go b/pkg/client/query/options.go index a335a68a3..8e5781d19 100644 --- a/pkg/client/query/options.go +++ b/pkg/client/query/options.go @@ -10,8 +10,8 @@ import ( ) const ( - defaultPruneOlderThan = 100 - defaultMaxKeys = 1000 + defaultMaxVersionAge = 100 + defaultMaxKeys = 1000 ) // paramsQuerierConfig is the configuration for parameter queriers. It is intended @@ -33,7 +33,7 @@ type ParamsQuerierOptionFn func(*paramsQuerierConfig) func DefaultParamsQuerierConfig() *paramsQuerierConfig { return ¶msQuerierConfig{ cacheOpts: []cache.QueryCacheOptionFn{ - cache.WithHistoricalMode(defaultPruneOlderThan), + cache.WithHistoricalMode(defaultMaxVersionAge), cache.WithMaxKeys(defaultMaxKeys), cache.WithEvictionPolicy(cache.FirstInFirstOut), },