if block is compacted within lookback period, and is within shard ranges, include it in search
(c *backend.CompactedBlockMeta, id common.ID, blockStart, blockEnd []byte, poll time.Duration, timeStart, timeEnd int64)
| 845 | |
| 846 | // if block is compacted within lookback period, and is within shard ranges, include it in search |
| 847 | func includeCompactedBlock(c *backend.CompactedBlockMeta, id common.ID, blockStart, blockEnd []byte, poll time.Duration, timeStart, timeEnd int64) bool { |
| 848 | lookback := time.Now().Add(-(2 * poll)) |
| 849 | if c.CompactedTime.Before(lookback) { |
| 850 | return false |
| 851 | } |
| 852 | return includeBlock(&c.BlockMeta, id, blockStart, blockEnd, timeStart, timeEnd) |
| 853 | } |
| 854 | |
| 855 | // createLegacyCache uses the config to return a cache and a list of roles. |
| 856 | func createLegacyCache(cfg *Config, logger gkLog.Logger) (cache.Cache, []cache.Role, error) { |