1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-26 15:42:21 +08:00

Fix goroutine leak in pin

License: MIT
Signed-off-by: Alec Brickner <alecjbrick@gmail.com>
This commit is contained in:
Alec Brickner
2018-05-10 18:58:59 -07:00
parent 7853e53860
commit f3f186b493

View File

@ -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
}
}
}
}()