1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-26 23:53:19 +08:00

Fix goroutine leak in dag put

License: MIT
Signed-off-by: Alec Brickner <alecjbrick@gmail.com>
This commit is contained in:
Alec Brickner
2018-05-12 03:35:42 -07:00
parent fc4ace2882
commit 4a59b557e7

View File

@ -128,7 +128,12 @@ into an object of the specified format.
cid := nds[0].Cid() cid := nds[0].Cid()
cids.Add(cid) cids.Add(cid)
outChan <- &OutputObject{Cid: cid}
select {
case outChan <- &OutputObject{Cid: cid}:
case <-req.Context().Done():
return nil
}
} }
if err := b.Commit(); err != nil { if err := b.Commit(); err != nil {