mirror of
https://github.com/kopia/kopia.git
synced 2026-05-19 20:24:46 -04:00
Close channel in the error case as well
This commit is contained in:
committed by
Jarek Kowalski
parent
2389abb465
commit
8526376e08
@@ -163,6 +163,7 @@ func (bm *lockFreeManager) tryLoadPackIndexBlobsUnlocked(ctx context.Context, co
|
||||
// unprocessedIndexBlobsUnlocked returns a closed channel filled with content IDs that are not in committedContents cache.
|
||||
func (bm *lockFreeManager) unprocessedIndexBlobsUnlocked(contents []IndexBlobInfo) (resultCh <-chan blob.ID, totalSize int64, err error) {
|
||||
ch := make(chan blob.ID, len(contents))
|
||||
defer close(ch)
|
||||
|
||||
for _, c := range contents {
|
||||
has, err := bm.committedContents.cache.hasIndexBlobID(c.BlobID)
|
||||
@@ -179,8 +180,6 @@ func (bm *lockFreeManager) unprocessedIndexBlobsUnlocked(contents []IndexBlobInf
|
||||
totalSize += c.Length
|
||||
}
|
||||
|
||||
close(ch)
|
||||
|
||||
return ch, totalSize, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user