| 797 | } |
| 798 | |
| 799 | func (rw *readerWriter) pollBlocklist(ctx context.Context) { |
| 800 | blocklist, compactedBlocklist, err := rw.blocklistPoller.Do(ctx, rw.blocklist) |
| 801 | if err != nil { |
| 802 | if ctx.Err() == nil { |
| 803 | level.Error(rw.logger).Log("msg", "failed to poll blocklist", "err", err) |
| 804 | } |
| 805 | |
| 806 | return |
| 807 | } |
| 808 | |
| 809 | rw.blocklist.ApplyPollResults(blocklist, compactedBlocklist) |
| 810 | |
| 811 | rw.pollerNotificationLock.Lock() |
| 812 | defer rw.pollerNotificationLock.Unlock() |
| 813 | |
| 814 | for _, fn := range rw.pollerNotificationFuncs { |
| 815 | fn() |
| 816 | } |
| 817 | |
| 818 | rw.pollerNotificationFuncs = rw.pollerNotificationFuncs[:0] |
| 819 | } |
| 820 | |
| 821 | // includeBlock indicates whether a given block should be included in a backend search |
| 822 | func includeBlock(b *backend.BlockMeta, _ common.ID, blockStart, blockEnd []byte, timeStart, timeEnd int64) bool { |