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

Method processUnusedSequence

db/change_cache.go:583–592  ·  view source on GitHub ↗

Process unused sequence notification. Extracts sequence from docID and sends to cache for buffering

(ctx context.Context, docID string, timeReceived channels.FeedTimestamp)

Source from the content-addressed store, hash-verified

581
582// Process unused sequence notification. Extracts sequence from docID and sends to cache for buffering
583func (c *changeCache) processUnusedSequence(ctx context.Context, docID string, timeReceived channels.FeedTimestamp) {
584 sequenceStr := strings.TrimPrefix(docID, c.metaKeys.UnusedSeqPrefix())
585 sequence, err := strconv.ParseUint(sequenceStr, 10, 64)
586 if err != nil {
587 base.WarnfCtx(ctx, "Unable to identify sequence number for unused sequence notification with key: %s, error: %v", base.UD(docID), err)
588 return
589 }
590 c.releaseUnusedSequence(ctx, sequence, timeReceived)
591
592}
593
594func (c *changeCache) releaseUnusedSequence(ctx context.Context, sequence uint64, timeReceived channels.FeedTimestamp) {
595 change := &LogEntry{

Callers 1

DocChangedMethod · 0.95

Calls 4

releaseUnusedSequenceMethod · 0.95
WarnfCtxFunction · 0.92
UDFunction · 0.92
UnusedSeqPrefixMethod · 0.80

Tested by

no test coverage detected