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

Function AllocateTestSequence

db/util_testing.go:676–680  ·  view source on GitHub ↗

AllocateTestSequence allocates a sequence via the sequenceAllocator. For use by non-db tests

(database *DatabaseContext)

Source from the content-addressed store, hash-verified

674
675// AllocateTestSequence allocates a sequence via the sequenceAllocator. For use by non-db tests
676func AllocateTestSequence(database *DatabaseContext) (uint64, error) {
677 database.sequences.mutex.Lock()
678 defer database.sequences.mutex.Unlock()
679 return database.sequences._incrementSequence(1)
680}
681
682// ReleaseTestSequence releases a sequence via the sequenceAllocator. For use by non-db tests
683func ReleaseTestSequence(ctx context.Context, database *DatabaseContext, sequence uint64) error {

Calls 3

_incrementSequenceMethod · 0.80
LockMethod · 0.45
UnlockMethod · 0.45