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

Function newFrontendCache

modules/frontend/pipeline/sync_handler_cache.go:125–140  ·  view source on GitHub ↗
(cacheProvider cache.Provider, role cache.Role, logger log.Logger)

Source from the content-addressed store, hash-verified

123}
124
125func newFrontendCache(cacheProvider cache.Provider, role cache.Role, logger log.Logger) *frontendCache {
126 var c cache.Cache
127 if cacheProvider != nil {
128 c = cacheProvider.CacheFor(role)
129 }
130
131 level.Info(logger).Log("msg", "init frontend cache", "role", role, "enabled", c != nil)
132
133 if c == nil {
134 return nil
135 }
136
137 return &frontendCache{
138 c: c,
139 }
140}
141
142// store stores the response body in the cache. the caller assumes the responsibility of closing the response body
143func (c *frontendCache) store(ctx context.Context, key string, buffer []byte) {

Callers 3

TestNilProviderFunction · 0.85
TestCacheCachesFunction · 0.85
NewCachingWareFunction · 0.85

Calls 2

CacheForMethod · 0.65
LogMethod · 0.65

Tested by 2

TestNilProviderFunction · 0.68
TestCacheCachesFunction · 0.68