MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / SetWithTTL

Method SetWithTTL

internal/cache/keyed_cache.go:27–29  ·  view source on GitHub ↗
(key string, value T, ttl time.Duration)

Source from the content-addressed store, hash-verified

25}
26
27func (c *KeyedCache[T]) SetWithTTL(key string, value T, ttl time.Duration) {
28 c.SetWithExpirable(key, value, ExpirationTime(time.Now().Add(ttl)))
29}
30
31func (c *KeyedCache[T]) SetWithExpirable(key string, value T, exp Expirable) {
32 c.mu.Lock()

Callers 3

DriverExtractFunction · 0.80
SetStorageDetailsMethod · 0.80
listFunction · 0.80

Calls 4

SetWithExpirableMethod · 0.95
ExpirationTimeTypeAlias · 0.85
AddMethod · 0.65
NowMethod · 0.65

Tested by

no test coverage detected