mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-02 06:47:51 +08:00
respect contexts when returning diagnostics responses
License: MIT Signed-off-by: Jeromy <why@ipfs.io>
This commit is contained in:
parent
1ca2d42889
commit
7728124b5e
@ -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)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user