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

Method FlushRevisionCacheForTest

db/util_testing.go:511–523  ·  view source on GitHub ↗

FlushRevisionCacheForTest creates a new revision cache. This is currently at the database level. Only use this in test code.

()

Source from the content-addressed store, hash-verified

509
510// FlushRevisionCacheForTest creates a new revision cache. This is currently at the database level. Only use this in test code.
511func (db *DatabaseContext) FlushRevisionCacheForTest() {
512 backingStores := make(map[uint32]RevisionCacheBackingStore, len(db.CollectionByID))
513 for i, v := range db.CollectionByID {
514 backingStores[i] = v
515 }
516
517 db.revisionCache = NewRevisionCache(
518 db.Options.RevisionCacheOptions,
519 backingStores,
520 db.DbStats.Cache(),
521 )
522
523}
524
525// TestBucketPoolWithIndexes runs a TestMain for packages that require creation of indexes
526func TestBucketPoolWithIndexes(ctx context.Context, m *testing.M, tbpOptions base.TestBucketPoolOptions) {

Calls 2

NewRevisionCacheFunction · 0.85
CacheMethod · 0.80