mirror of https://github.com/perkeep/perkeep.git
Merge "pkg/search: lock index for corpus creation"
This commit is contained in:
commit
7ef7c34a7c
|
@ -146,11 +146,14 @@ func newHandlerFromConfig(ld blobserver.Loader, conf jsonconfig.Obj) (http.Handl
|
|||
h := NewHandler(indexer, ownerBlobRef)
|
||||
if slurpToMemory {
|
||||
ii := indexer.(*index.Index)
|
||||
ii.Lock()
|
||||
corpus, err := ii.KeepInMemory()
|
||||
if err != nil {
|
||||
ii.Unlock()
|
||||
return nil, fmt.Errorf("error slurping index to memory: %v", err)
|
||||
}
|
||||
h.corpus = corpus
|
||||
ii.Unlock()
|
||||
}
|
||||
return h, nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue