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

Method MaxCacheSize

db/channel_cache.go:423–440  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

421}
422
423func (c *channelCacheImpl) MaxCacheSize(ctx context.Context) int {
424
425 maxCacheSize := 0
426 callback := func(v interface{}) bool {
427 channelCache := AsSingleChannelCache(ctx, v)
428 if channelCache == nil {
429 return false
430 }
431 channelSize := channelCache.GetSize()
432 if channelSize > maxCacheSize {
433 maxCacheSize = channelSize
434 }
435 return true
436 }
437 c.channelCaches.Range(callback)
438
439 return maxCacheSize
440}
441
442func (c *channelCacheImpl) isCompactActive() bool {
443 return c.compactRunning.IsTrue()

Callers

nothing calls this directly

Calls 3

AsSingleChannelCacheFunction · 0.85
GetSizeMethod · 0.80
RangeMethod · 0.80

Tested by

no test coverage detected