mirror of
https://github.com/perkeep/perkeep.git
synced 2025-02-26 20:25:07 +00:00
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() {
|
go func() {
|
||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
for br := range ch {
|
for br := range ch {
|
||||||
|
sh.index.RLock()
|
||||||
bm, err := sh.index.GetBlobMeta(ctx, br)
|
bm, err := sh.index.GetBlobMeta(ctx, br)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
sh.wsHub.newBlobRecv <- bm.CamliType
|
sh.wsHub.newBlobRecv <- bm.CamliType
|
||||||
}
|
}
|
||||||
|
sh.index.RUnlock()
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user