Skip to content

Commit

Permalink
Merge pull request #3353 from ipfs/fix/diag-hang
Browse files Browse the repository at this point in the history
respect contexts when returning diagnostics responses
  • Loading branch information
whyrusleeping committed Nov 4, 2016
2 parents a9df187 + 7728124 commit 4b82c89
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion diagnostics/diag.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ func (d *Diagnostics) getDiagnosticFromPeers(ctx context.Context, peers map[peer
return
}
for d := range out {
respdata <- d
select {
case respdata <- d:
case <-ctx.Done():
return
}
}
}(p)
}
Expand Down

0 comments on commit 4b82c89

Please sign in to comment.