Skip to content

Commit

Permalink
add back fix for thanos-io#3240
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <[email protected]>
  • Loading branch information
yeya24 committed Oct 5, 2020
1 parent 4920918 commit 86d1478
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 4 additions & 1 deletion cmd/thanos/query_frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ func runQueryFrontend(
if err != nil {
return errors.Wrap(err, "initializing the query frontend config")
}

if cfg.CortexResultsCacheConfig.CacheConfig.Memcache.Expiration == 0 {
level.Warn(logger).Log("msg", "memcached cache valid time set to 0, so using a default of 24 hours expiration time")
cfg.CortexResultsCacheConfig.CacheConfig.Memcache.Expiration = 24 * time.Hour
}
cfg.CortexResultsCacheConfig = &queryrange.ResultsCacheConfig{
Compression: cfg.CacheCompression,
CacheConfig: *cacheConfig,
Expand Down
5 changes: 0 additions & 5 deletions pkg/queryfrontend/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ func NewCacheConfig(logger log.Logger, confContentYaml []byte) (*cortexcache.Con
level.Warn(logger).Log("message", "MaxItemSize is not yet supported by the memcached client")
}

if config.Expiration == 0 {
level.Warn(logger).Log("msg", "memcached cache valid time set to 0, so using a default of 24 hours expiration time")
config.Expiration = 24 * time.Hour
}

return &cortexcache.Config{
Memcache: cortexcache.MemcachedConfig{
Expiration: config.Expiration,
Expand Down

0 comments on commit 86d1478

Please sign in to comment.