mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-09 23:42:20 +08:00
dht/bootstrap: timeout queries
This commit is contained in:
@ -140,6 +140,8 @@ func (dht *IpfsDHT) runBootstrap(ctx context.Context, queries int) error {
|
||||
}
|
||||
|
||||
// bootstrap sequentially, as results will compound
|
||||
ctx, cancel := context.WithTimeout(ctx, DefaultBootstrapTimeout)
|
||||
defer cancel()
|
||||
runQuery := func(ctx context.Context, id peer.ID) {
|
||||
p, err := dht.FindPeer(ctx, id)
|
||||
if err == routing.ErrNotFound {
|
||||
|
Reference in New Issue
Block a user