MCPcopy Create free account
hub / github.com/encoder-run/operator / fetchNextBatch

Method fetchNextBatch

pkg/cache/redis/reference.go:167–178  ·  view source on GitHub ↗

fetchNextBatch fetches the next batch of keys from Redis matching the pattern "ref:*".

()

Source from the content-addressed store, hash-verified

165
166// fetchNextBatch fetches the next batch of keys from Redis matching the pattern "ref:*".
167func (iter *ReferenceIter) fetchNextBatch() {
168 if iter.moreData {
169 var err error
170 iter.keys, iter.cursor, err = iter.client.Scan(ctx, iter.cursor, withNamespace(iter.namespacePrefix, referencePrefix, "*"), 100).Result()
171 if err != nil {
172 iter.moreData = false // In case of error, stop further fetching
173 return
174 }
175 // Update moreData based on whether the cursor returned to 0
176 iter.moreData = (iter.cursor != 0)
177 }
178}
179
180// Next retrieves the next reference, advancing the iterator.
181func (iter *ReferenceIter) Next() (*plumbing.Reference, error) {

Callers 2

IterReferencesMethod · 0.95
NextMethod · 0.95

Calls 1

withNamespaceFunction · 0.85

Tested by

no test coverage detected