Skip to content

Commit

Permalink
Merge pull request #5016 from alecbrick/fix/dag-goroutine-leak
Browse files Browse the repository at this point in the history
Fix goroutine leak in dag put
  • Loading branch information
whyrusleeping authored May 24, 2018
2 parents d99d3d9 + 4a59b55 commit 06f11bd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/commands/dag/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,12 @@ into an object of the specified format.

cid := nds[0].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 {
Expand Down

0 comments on commit 06f11bd

Please sign in to comment.