MCPcopy
hub / github.com/grafana/tempo / NewClient

Function NewClient

modules/cache/redis/redis.go:18–30  ·  view source on GitHub ↗
(cfg *Config, cfgBackground *cache.BackgroundConfig, name string, logger log.Logger)

Source from the content-addressed store, hash-verified

16}
17
18func NewClient(cfg *Config, cfgBackground *cache.BackgroundConfig, name string, logger log.Logger) cache.Cache {
19 if cfg.ClientConfig.Timeout == 0 {
20 cfg.ClientConfig.Timeout = 100 * time.Millisecond
21 }
22 if cfg.ClientConfig.Expiration == 0 {
23 cfg.ClientConfig.Expiration = cfg.TTL
24 }
25
26 client := cache.NewRedisClient(&cfg.ClientConfig)
27 c := cache.NewRedisCache(name, client, prometheus.DefaultRegisterer, logger)
28
29 return cache.NewBackground(name, *cfgBackground, c, prometheus.DefaultRegisterer)
30}

Callers 2

createLegacyCacheFunction · 0.92
NewProviderFunction · 0.92

Calls 3

NewRedisClientFunction · 0.92
NewRedisCacheFunction · 0.92
NewBackgroundFunction · 0.92

Tested by

no test coverage detected