()
| 114 | } |
| 115 | |
| 116 | func (h *Handler) subscribeToNewBlobs() { |
| 117 | ch := make(chan blob.Ref, buffered) |
| 118 | blobserver.GetHub(h.index).RegisterListener(ch) |
| 119 | go func() { |
| 120 | ctx := context.Background() |
| 121 | for br := range ch { |
| 122 | h.index.RLock() |
| 123 | bm, err := h.index.GetBlobMeta(ctx, br) |
| 124 | if err == nil { |
| 125 | h.wsHub.newBlobRecv <- bm.CamliType |
| 126 | } |
| 127 | h.index.RUnlock() |
| 128 | } |
| 129 | }() |
| 130 | } |
| 131 | |
| 132 | func (h *Handler) SetCorpus(c *index.Corpus) { |
| 133 | h.corpus = c |
no test coverage detected