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

Method SetAsync

cache/lru.go:81–92  ·  view source on GitHub ↗
(key string, value []byte, ttl time.Duration)

Source from the content-addressed store, hash-verified

79}
80
81func (l *LRUCache) SetAsync(key string, value []byte, ttl time.Duration) {
82 l.c.SetAsync(key, value, ttl)
83
84 l.mtx.Lock()
85 defer l.mtx.Unlock()
86
87 expires := time.Now().Add(ttl)
88 l.lru.Add(key, &Item{
89 Data: value,
90 ExpiresAt: expires,
91 })
92}
93
94func (l *LRUCache) SetMultiAsync(data map[string][]byte, ttl time.Duration) {
95 // store the data in the shared cache.

Callers

nothing calls this directly

Calls 2

SetAsyncMethod · 0.65
AddMethod · 0.65

Tested by

no test coverage detected