some tweaks
- select 25 of 50 relays instead of 20 - increase connect timeout to 30s
This commit is contained in:
parent
f9e182f747
commit
4629431a12
|
@ -162,7 +162,7 @@ again:
|
|||
|
||||
log.Debugf("discovered %d relays", len(pis))
|
||||
|
||||
pis = ar.selectRelays(ctx, pis, 20, 50)
|
||||
pis = ar.selectRelays(ctx, pis, 25, 50)
|
||||
update := 0
|
||||
|
||||
for _, pi := range pis {
|
||||
|
@ -173,7 +173,7 @@ again:
|
|||
}
|
||||
ar.mx.Unlock()
|
||||
|
||||
cctx, cancel := context.WithTimeout(ctx, 15*time.Second)
|
||||
cctx, cancel := context.WithTimeout(ctx, 30*time.Second)
|
||||
err = ar.host.Connect(cctx, pi)
|
||||
cancel()
|
||||
if err != nil {
|
||||
|
@ -254,6 +254,8 @@ func (ar *AutoRelay) selectRelays(ctx context.Context, pis []pstore.PeerInfo, co
|
|||
resultCh <- queryResult{pi: pstore.PeerInfo{ID: pi.ID, Addrs: addrs}, err: nil}
|
||||
continue
|
||||
}
|
||||
|
||||
// no known addrs, do a query
|
||||
go func(p peer.ID) {
|
||||
pi, err := ar.router.FindPeer(qctx, p)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue