StartChangeCache is called from the cache benchmarking tool to init the change cache, not to be called from outside test code
(t *testing.T, ctx context.Context)
| 83 | // StartChangeCache is called from the cache benchmarking tool to init the change cache, not to be called |
| 84 | // from outside test code |
| 85 | func (db *DatabaseContext) StartChangeCache(t *testing.T, ctx context.Context) { |
| 86 | notifyChange := func(ctx context.Context, changedChannels channels.Set) { |
| 87 | db.mutationListener.Notify(ctx, changedChannels) |
| 88 | } |
| 89 | |
| 90 | // Initialize the change cache |
| 91 | if err := db.changeCache.Init( |
| 92 | ctx, |
| 93 | db, |
| 94 | db.channelCache, |
| 95 | notifyChange, |
| 96 | db.Options.CacheOptions, |
| 97 | db.MetadataKeys, |
| 98 | ); err != nil { |
| 99 | t.Fatal(err) |
| 100 | } |
| 101 | db.mutationListener.OnChangeCallback = db.changeCache.DocChanged |
| 102 | db.changeCache.lock.Unlock() |
| 103 | |
| 104 | // start broadcast goroutine |
| 105 | db.mutationListener.StartNotifierBroadcaster(ctx) |
| 106 | } |
| 107 | |
| 108 | // CallProcessEntry allows the cache benchmarking tool to call directly into processEntry, not to |
| 109 | // be used from outside test code |
no test coverage detected