MCPcopy Create free account
hub / github.com/TalkingData/owl / newCacheWithJanitor

Function newCacheWithJanitor

controller/cache/cache.go:272–281  ·  view source on GitHub ↗
(defaultExpiration time.Duration, cleanupInterval time.Duration, items map[string]Item)

Source from the content-addressed store, hash-verified

270}
271
272func newCacheWithJanitor(defaultExpiration time.Duration, cleanupInterval time.Duration, items map[string]Item) *Cache {
273 c := newCache(defaultExpiration, items)
274 //init Cache
275 C := &Cache{c}
276 if cleanupInterval > 0 {
277 runJanitor(c, cleanupInterval)
278 runtime.SetFinalizer(C, stopJanitor)
279 }
280 return C
281}
282
283func New(defaultExpiration, cleanupInterval time.Duration) *Cache {
284 items := make(map[string]Item)

Callers 1

NewFunction · 0.85

Calls 2

newCacheFunction · 0.85
runJanitorFunction · 0.85

Tested by

no test coverage detected