MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / cleanAgedItems

Method cleanAgedItems

db/channel_cache.go:303–316  ·  view source on GitHub ↗

CleanAgedItems prunes the caches based on age of items. Error returned to fulfill BackgroundTaskFunc signature.

(ctx context.Context)

Source from the content-addressed store, hash-verified

301
302// CleanAgedItems prunes the caches based on age of items. Error returned to fulfill BackgroundTaskFunc signature.
303func (c *channelCacheImpl) cleanAgedItems(ctx context.Context) error {
304
305 callback := func(v interface{}) bool {
306 channelCache := AsSingleChannelCache(ctx, v)
307 if channelCache == nil {
308 return false
309 }
310 channelCache.pruneCacheAge(ctx)
311 return true
312 }
313 c.channelCaches.Range(callback)
314
315 return nil
316}
317
318func (c *channelCacheImpl) getChannelCache(ctx context.Context, channel channels.ID) (SingleChannelCache, error) {
319

Callers

nothing calls this directly

Calls 3

AsSingleChannelCacheFunction · 0.85
pruneCacheAgeMethod · 0.80
RangeMethod · 0.80

Tested by

no test coverage detected