mirror of
https://github.com/fluencelabs/go-libp2p-kad-dht
synced 2025-07-01 13:41:38 +00:00
don't ignore returned cancelFunc()
This commit is contained in:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user