summaryrefslogtreecommitdiff
path: root/src/cache.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cache.go')
-rw-r--r--src/cache.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cache.go b/src/cache.go
index 39d4250d..130915db 100644
--- a/src/cache.go
+++ b/src/cache.go
@@ -22,6 +22,14 @@ func (cc *ChunkCache) Clear() {
cc.mutex.Unlock()
}
+func (cc *ChunkCache) retire(chunk ...*Chunk) {
+ cc.mutex.Lock()
+ for _, c := range chunk {
+ delete(cc.cache, c)
+ }
+ cc.mutex.Unlock()
+}
+
// Add adds the list to the cache
func (cc *ChunkCache) Add(chunk *Chunk, key string, list []Result) {
if len(key) == 0 || !chunk.IsFull() || len(list) > queryCacheMax {