mirror of https://github.com/status-im/consul.git
Move initialization of the rebalanceTimer to New()
This commit is contained in:
parent
5652c60971
commit
3d00208351
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue