mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-03 21:33:07 +00:00
make connection timeout a variable, set for 30s (instead of 10s)
This commit is contained in:
parent
f280c5f705
commit
a4c5325665
@ -46,6 +46,9 @@ var (
|
||||
|
||||
// number of active connection attempts for peers obtained through px
|
||||
GossipSubConnectors = 16
|
||||
|
||||
// timeout for connection attempts
|
||||
GossipSubConnectionTimeout = 30 * time.Second
|
||||
)
|
||||
|
||||
// NewGossipSub returns a new PubSub object using GossipSubRouter as the router.
|
||||
@ -341,7 +344,7 @@ func (gs *GossipSubRouter) connector() {
|
||||
gs.p.host.Peerstore().AddCertifiedAddrs(ci.srr, peerstore.TempAddrTTL)
|
||||
}
|
||||
|
||||
ctx, cancel := context.WithTimeout(gs.p.ctx, 10*time.Second)
|
||||
ctx, cancel := context.WithTimeout(gs.p.ctx, GossipSubConnectionTimeout)
|
||||
err := gs.p.host.Connect(ctx, peer.AddrInfo{ID: ci.p})
|
||||
cancel()
|
||||
if err != nil {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user