update with knits from davec and an additional one from me
This commit is contained in:
parent
568c0044a0
commit
1e77c8e554
1 changed files with 4 additions and 5 deletions
9
peer.go
9
peer.go
|
@ -1209,7 +1209,6 @@ func newOutboundPeer(s *server, addr string, persistent bool) *peer {
|
||||||
log.Debugf("[SRVR] Attempting to connect to %s", faddr)
|
log.Debugf("[SRVR] Attempting to connect to %s", faddr)
|
||||||
conn, err := dial("tcp", addr)
|
conn, err := dial("tcp", addr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
baseRetryInterval := time.Second * 10
|
|
||||||
p.retrycount += 1
|
p.retrycount += 1
|
||||||
log.Errorf("[SRVR] Failed to connect to %s: %v",
|
log.Errorf("[SRVR] Failed to connect to %s: %v",
|
||||||
faddr, err)
|
faddr, err)
|
||||||
|
@ -1218,11 +1217,11 @@ func newOutboundPeer(s *server, addr string, persistent bool) *peer {
|
||||||
p.wg.Done()
|
p.wg.Done()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
scaledRetryInterval := baseRetryInterval.Nanoseconds() * p.retrycount / 2
|
scaledInterval := connectionRetryInterval.Nanoseconds() * p.retrycount / 2
|
||||||
scaledRetrySeconds := time.Duration(scaledRetryInterval)
|
scaledDuration := time.Duration(scaledInterval)
|
||||||
log.Infof("[SRVR] Retrying connection to %s "+
|
log.Infof("[SRVR] Retrying connection to %s "+
|
||||||
"in %v", faddr, scaledRetrySeconds)
|
"in %s", faddr, scaledDuration)
|
||||||
time.Sleep(scaledRetrySeconds)
|
time.Sleep(scaledDuration)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue