mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-10 11:52:21 +08:00
Fix 'ctx, _' to have explicit cancel
License: MIT Signed-off-by: rht <rhtbot@gmail.com>
This commit is contained in:
@ -320,7 +320,8 @@ func setupDiscoveryOption(d config.Discovery) DiscoveryOption {
|
||||
|
||||
func (n *IpfsNode) HandlePeerFound(p peer.PeerInfo) {
|
||||
log.Warning("trying peer info: ", p)
|
||||
ctx, _ := context.WithTimeout(n.Context(), time.Second*10)
|
||||
ctx, cancel := context.WithTimeout(n.Context(), time.Second*10)
|
||||
defer cancel()
|
||||
if err := n.PeerHost.Connect(ctx, p); err != nil {
|
||||
log.Warning("Failed to connect to peer found by discovery: ", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user