MCPcopy
hub / github.com/grafana/dskit / SetMultiAsync

Method SetMultiAsync

cache/lru.go:94–108  ·  cache/lru.go::LRUCache.SetMultiAsync
(data map[string][]byte, ttl time.Duration)

Source from the content-addressed store, hash-verified

92}
93
94func (l *LRUCache) SetMultiAsync(data map[string][]byte, ttl time.Duration) {
95 // store the data in the shared cache.
96 l.c.SetMultiAsync(data, ttl)
97
98 l.mtx.Lock()
99 defer l.mtx.Unlock()
100
101 expires := time.Now().Add(ttl)
102 for k, v := range data {
103 l.lru.Add(k, &Item{
104 Data: v,
105 ExpiresAt: expires,
106 })
107 }
108}
109
110func (l *LRUCache) Set(ctx context.Context, key string, value []byte, ttl time.Duration) error {
111 err := l.c.Set(ctx, key, value, ttl)

Callers

nothing calls this directly

Calls 2

SetMultiAsyncMethod · 0.65
AddMethod · 0.65

Tested by

no test coverage detected