don't ignore returned cancelFunc()
Henry committed
Feb 25, 2015 at 14:39 UTC
435e8188a3a55bbdfaf0582eb14484825ff0cc2d
1 file changed
+2
-1
routing/dht/records.go
+2
-1
@@ -28,7 +28,8 @@ func (dht *IpfsDHT) getPublicKeyOnline(ctx context.Context, p peer.ID) (ci.PubKe
28
}
29
30
// ok, try the node itself. if they're overwhelmed or slow we can move on.
31
- ctxT, _ := ctxutil.WithDeadlineFraction(ctx, 0.3)
31
+ ctxT, cancelFunc := ctxutil.WithDeadlineFraction(ctx, 0.3)
32
+ defer cancelFunc()
33
if pk, err := dht.getPublicKeyFromNode(ctx, p); err == nil {
34
return pk, nil
35
}