_releaseCurrentBatch releases any unused sequences currently held by the allocator. Writes unused sequence document while holding s.lock, shouldn't be used by high-throughput operations.
(ctx context.Context)
| 190 | // _releaseCurrentBatch releases any unused sequences currently held by the allocator. |
| 191 | // Writes unused sequence document while holding s.lock, shouldn't be used by high-throughput operations. |
| 192 | func (s *sequenceAllocator) _releaseCurrentBatch(ctx context.Context) (numReleased uint64, err error) { |
| 193 | if s.max > s.last { |
| 194 | numReleased, err = s.releaseSequenceRange(ctx, s.last+1, s.max) |
| 195 | if err != nil { |
| 196 | return 0, err |
| 197 | } |
| 198 | s.last = s.max |
| 199 | } |
| 200 | return numReleased, nil |
| 201 | } |
| 202 | |
| 203 | // nextSequenceGreaterThan increments _sync:seq such that it's greater than existingSequence + s.sequenceBatchSize |
| 204 | // In the case where our local s.max < _sync:seq (another node has incremented _sync:seq), we may be releasing |
no test coverage detected