go/store/chunks: memory_store.go: Fix MarkAndSweepChunks implementation to return successfully when keepChunks is closed.

This commit is contained in:
Aaron Son
2020-10-12 16:38:18 -07:00
committed by Andy Arthur
parent 678f849879
commit 597d15f0a6
+5 -1
View File
@@ -228,9 +228,13 @@ func (ms *MemoryStoreView) MarkAndSweepChunks(ctx context.Context, last hash.Has
keepers := make(map[hash.Hash]Chunk, ms.storage.Len())
LOOP:
for {
select {
case h := <-keepChunks:
case h, ok := <-keepChunks:
if !ok {
break LOOP
}
c, err := ms.Get(ctx, h)
if err != nil {
return err