This is the RevisionCacheLoaderFunc callback for the context's RevisionCache. Its job is to load a revision from the bucket when there's a cache miss.
(ctx context.Context, backingStore RevisionCacheBackingStore, id IDAndRev)
| 412 | // This is the RevisionCacheLoaderFunc callback for the context's RevisionCache. |
| 413 | // Its job is to load a revision from the bucket when there's a cache miss. |
| 414 | func revCacheLoader(ctx context.Context, backingStore RevisionCacheBackingStore, id IDAndRev) (bodyBytes []byte, history Revisions, channels base.Set, removed bool, attachments AttachmentsMeta, deleted bool, expiry *time.Time, hlv *HybridLogicalVector, err error) { |
| 415 | var doc *Document |
| 416 | if doc, err = backingStore.GetDocument(ctx, id.DocID, DocUnmarshalSync); doc == nil { |
| 417 | return bodyBytes, history, channels, removed, attachments, deleted, expiry, hlv, err |
| 418 | } |
| 419 | return revCacheLoaderForDocument(ctx, backingStore, doc, id.RevID) |
| 420 | } |
| 421 | |
| 422 | // revCacheLoaderForCv will load a document from the bucket using the CV, compare the fetched doc and the CV specified in the function, |
| 423 | // and will still return revid for purpose of populating the Rev ID lookup map on the cache |
no test coverage detected