From 3d0020835125842bc9bcdc06bd46f011eaa1688c Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Sun, 27 Mar 2016 00:03:48 -0700 Subject: [PATCH] Move initialization of the rebalanceTimer to New() --- consul/server_manager/server_manager.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/consul/server_manager/server_manager.go b/consul/server_manager/server_manager.go index 7f11098242..193db400d0 100644 --- a/consul/server_manager/server_manager.go +++ b/consul/server_manager/server_manager.go @@ -225,6 +225,7 @@ func New(logger *log.Logger, shutdownCh chan struct{}, clusterInfo ConsulCluster sm.logger = logger sm.clusterInfo = clusterInfo // can't pass *consul.Client: import cycle sm.connPoolPinger = connPoolPinger // can't pass *consul.ConnPool: import cycle + sm.rebalanceTimer = time.NewTimer(clientRPCMinReuseDuration) sm.shutdownCh = shutdownCh sc := serverConfig{} @@ -440,8 +441,6 @@ func (sm *ServerManager) ResetRebalanceTimer() { // the list. The order of the server list must be shuffled periodically to // distribute load across all known and available consul servers. func (sm *ServerManager) Start() { - sm.rebalanceTimer = time.NewTimer(clientRPCMinReuseDuration) - for { select { case <-sm.rebalanceTimer.C: