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

Method updateHighCacheSequence

db/channel_cache.go:170–176  ·  view source on GitHub ↗

Updates the high cache sequence if the incoming sequence is higher than current Note: doesn't require compareAndSet on update, as cache expects AddToCache to only be called from a single goroutine

(sequence uint64)

Source from the content-addressed store, hash-verified

168// Note: doesn't require compareAndSet on update, as cache expects AddToCache to only be called from
169// a single goroutine
170func (c *channelCacheImpl) updateHighCacheSequence(sequence uint64) {
171 c.seqLock.Lock()
172 if sequence > c.highCacheSequence {
173 c.highCacheSequence = sequence
174 }
175 c.seqLock.Unlock()
176}
177
178// GetSingleChannelCache will create the cache for the channel if it doesn't exist. If the cache is at
179// capacity, will return a bypass channel cache.

Callers 3

AddPrincipalMethod · 0.95
AddUnusedSequenceMethod · 0.95
AddToCacheMethod · 0.95

Calls 2

LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected