Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit 1da8f6b

Browse files
committed
tweak: Add timeout to network bootstrapping
1 parent 67c19f2 commit 1da8f6b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mobile/node.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,13 @@ func (n *Node) startIPFSNode(repoPath string, config *ipfscore.BuildCfg) (*ipfsc
324324
n.cancel = cancel
325325

326326
ctx := commands.Context{}
327+
328+
ipfscore.DefaultBootstrapConfig = ipfscore.BootstrapConfig{
329+
MinPeerThreshold: 8,
330+
Period: time.Second * 10,
331+
ConnectionTimeout: time.Second * 10 / 3,
332+
}
333+
327334
nd, err := ipfscore.NewNode(cctx, config)
328335
if err != nil {
329336
return nil, ctx, err

0 commit comments

Comments
 (0)