From 1e77c8e55484d7db79f755e9c4feb41fe0c09c0d Mon Sep 17 00:00:00 2001 From: "Todd T. Fries" Date: Thu, 26 Sep 2013 16:45:10 -0500 Subject: [PATCH] update with knits from davec and an additional one from me --- peer.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/peer.go b/peer.go index f73aeecc..ebb70c0c 100644 --- a/peer.go +++ b/peer.go @@ -1209,7 +1209,6 @@ func newOutboundPeer(s *server, addr string, persistent bool) *peer { log.Debugf("[SRVR] Attempting to connect to %s", faddr) conn, err := dial("tcp", addr) if err != nil { - baseRetryInterval := time.Second * 10 p.retrycount += 1 log.Errorf("[SRVR] Failed to connect to %s: %v", faddr, err) @@ -1218,11 +1217,11 @@ func newOutboundPeer(s *server, addr string, persistent bool) *peer { p.wg.Done() return } - scaledRetryInterval := baseRetryInterval.Nanoseconds() * p.retrycount / 2 - scaledRetrySeconds := time.Duration(scaledRetryInterval) + scaledInterval := connectionRetryInterval.Nanoseconds() * p.retrycount / 2 + scaledDuration := time.Duration(scaledInterval) log.Infof("[SRVR] Retrying connection to %s "+ - "in %v", faddr, scaledRetrySeconds) - time.Sleep(scaledRetrySeconds) + "in %s", faddr, scaledDuration) + time.Sleep(scaledDuration) continue }