diff --git a/core/commands/dag/dag.go b/core/commands/dag/dag.go index 2e069a60f..d456f70e2 100644 --- a/core/commands/dag/dag.go +++ b/core/commands/dag/dag.go @@ -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 {