Share a source index across each pipeline run
This commit is contained in:
@@ -13,10 +13,13 @@ func artifactProducerCache(input RunInput, typed *preparedTypedLane, class contr
|
||||
if input.Cache == nil || class != contracts.ExecutionClassLLMBacked {
|
||||
return nil
|
||||
}
|
||||
sourceIndex := input.cacheSourceIndex
|
||||
if sourceIndex == nil {
|
||||
sourceIndex := func() *source.DocumentIndex { return input.sourceIndex }
|
||||
if input.sourceIndex == nil {
|
||||
// Standalone operation construction can also defer indexing until decode.
|
||||
sourceIndex = sync.OnceValue(func() source.DocumentIndex { return source.NewDocumentIndex(doc) })
|
||||
sourceIndex = sync.OnceValue(func() *source.DocumentIndex {
|
||||
index := source.NewDocumentIndex(doc)
|
||||
return &index
|
||||
})
|
||||
}
|
||||
return &contracts.ProducerCache[any]{
|
||||
Store: input.Cache,
|
||||
|
||||
Reference in New Issue
Block a user