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

Method Start

db/change_cache.go:196–212  ·  view source on GitHub ↗
(initialSequence uint64)

Source from the content-addressed store, hash-verified

194}
195
196func (c *changeCache) Start(initialSequence uint64) error {
197
198 // Unlock the cache after this function returns.
199 defer c.lock.Unlock()
200
201 // Set initial sequence for sequence buffering
202 c._setInitialSequence(initialSequence)
203
204 // Set initial sequence for cache (validFrom)
205 c.channelCache.Init(initialSequence)
206
207 if !c.started.CompareAndSwap(false, true) {
208 return errors.New("changeCache already started")
209 }
210
211 return nil
212}
213
214// Stops the cache. Clears its state and tells the housekeeping task to stop.
215func (c *changeCache) Stop(ctx context.Context) {

Calls 4

_setInitialSequenceMethod · 0.95
CompareAndSwapMethod · 0.80
InitMethod · 0.65
UnlockMethod · 0.45