Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pkg/chunk/cache/memcached.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,13 @@ func NewMemcached(cfg MemcachedConfig, client MemcachedClient, name string, reg
batchID: input.batchID,
}
res.found, res.bufs, res.missed = c.fetch(input.ctx, input.keys)
input.resultCh <- res
// No-one will be reading from resultCh if we were asked to quit
// during the fetch, so check again before writing to it.
select {
case <-c.quit:
return
case input.resultCh <- res:
}
}
}
}()
Expand Down Expand Up @@ -214,7 +220,6 @@ loopResults:
results[result.batchID] = result
}
}
close(resultsCh)

for _, result := range results {
if result == nil {
Expand Down