Skip to content

Commit

Permalink
Merge pull request #5011 from alecbrick/fix/pin-goroutine-leak
Browse files Browse the repository at this point in the history
Fix goroutine leak in pin verify
  • Loading branch information
whyrusleeping authored May 12, 2018
2 parents 7853e53 + f3f186b commit fc4ace2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/commands/pin.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,11 @@ func pinVerify(ctx context.Context, n *core.IpfsNode, opts pinVerifyOpts) <-chan
for _, cid := range recPins {
pinStatus := checkPin(cid)
if !pinStatus.Ok || opts.includeOk {
out <- &PinVerifyRes{cid.String(), pinStatus}
select {
case out <- &PinVerifyRes{cid.String(), pinStatus}:
case <-ctx.Done():
return
}
}
}
}()
Expand Down

0 comments on commit fc4ace2

Please sign in to comment.