Commit 435e8188 authored by Henry's avatar Henry

don't ignore returned cancelFunc()

parent 006df7db
...@@ -28,7 +28,8 @@ func (dht *IpfsDHT) getPublicKeyOnline(ctx context.Context, p peer.ID) (ci.PubKe ...@@ -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. // 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 { if pk, err := dht.getPublicKeyFromNode(ctx, p); err == nil {
return pk, nil return pk, nil
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment