Skip to content

Commit

Permalink
fix: close channel if it is not closed
Browse files Browse the repository at this point in the history
  • Loading branch information
nugaon committed Dec 4, 2023
1 parent 012c8c6 commit 9cd6f19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/file/redundancy/getter/getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func (g *getter) cautiousStrategy(ctx context.Context) error {
return
}
g.setErasureData(c.pos, ch.Data())
if c.pos < len(g.sAddresses) {
if c.pos < len(g.sAddresses) && !channelIsClosed(c.wait) {
close(c.wait)
}
retrievedCh <- struct{}{}
Expand Down

0 comments on commit 9cd6f19

Please sign in to comment.