mirror of
https://github.com/fluencelabs/go-libp2p-kad-dht
synced 2025-04-24 22:32:13 +00:00
don't ignore returned cancelFunc()
This commit is contained in:
parent
be9c9b8d78
commit
cf59044ecc
@ -28,7 +28,8 @@ func (dht *IpfsDHT) getPublicKeyOnline(ctx context.Context, p peer.ID) (ci.PubKe
|
||||
}
|
||||
|
||||
// ok, try the node itself. if they're overwhelmed or slow we can move on.
|
||||
ctxT, _ := ctxutil.WithDeadlineFraction(ctx, 0.3)
|
||||
ctxT, cancelFunc := ctxutil.WithDeadlineFraction(ctx, 0.3)
|
||||
defer cancelFunc()
|
||||
if pk, err := dht.getPublicKeyFromNode(ctx, p); err == nil {
|
||||
return pk, nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user