mirror of https://github.com/perkeep/perkeep.git
pkg/search: RLock index around GetBlobMeta
Because GetBlobMeta is a corpus read, we need to RLock around it. Context: issue #750 Change-Id: I5b1e33d05b04aaecb0ad49f3af2d46d14b04dbfb
This commit is contained in:
parent
0ddc0d7ef4
commit
d2818d5079
|
@ -95,10 +95,12 @@ func (sh *Handler) subscribeToNewBlobs() {
|
|||
go func() {
|
||||
ctx := context.Background()
|
||||
for br := range ch {
|
||||
sh.index.RLock()
|
||||
bm, err := sh.index.GetBlobMeta(ctx, br)
|
||||
if err == nil {
|
||||
sh.wsHub.newBlobRecv <- bm.CamliType
|
||||
}
|
||||
sh.index.RUnlock()
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue