Move initialization of the rebalanceTimer to New()

This commit is contained in:
Sean Chittenden 2016-03-27 00:03:48 -07:00
parent 5652c60971
commit 3d00208351
1 changed files with 1 additions and 2 deletions

View File

@ -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: