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

Function runAllocator

db/sequence_allocator_test.go:877–892  ·  view source on GitHub ↗
(ctx context.Context, a *sequenceAllocator, frequency time.Duration)

Source from the content-addressed store, hash-verified

875}
876
877func runAllocator(ctx context.Context, a *sequenceAllocator, frequency time.Duration) (allocationCount uint64) {
878
879 allocationCount = 0
880 ticker := time.NewTicker(frequency)
881 for {
882 select {
883 case <-ticker.C:
884 _, _ = a.nextSequence(ctx)
885 allocationCount++
886 case <-ctx.Done():
887 ticker.Stop()
888 log.Printf("allocator count: %v", allocationCount)
889 return allocationCount
890 }
891 }
892}
893
894func getClientSequenceBatchSize(allocator *sequenceAllocator) uint64 {
895 allocator.mutex.Lock()

Callers 1

Calls 3

nextSequenceMethod · 0.80
DoneMethod · 0.80
StopMethod · 0.65

Tested by

no test coverage detected