mirror of
https://github.com/status-im/consul.git
synced 2025-01-12 06:44:41 +00:00
Properly retain a pointer to the rebalanceTimer
This commit is contained in:
parent
00ff8e5307
commit
a7091b0837
@ -300,7 +300,6 @@ func (sc *serverConfig) resetRebalanceTimer(sm *ServerManager) {
|
||||
// happens either when a new server is added or when a duration has been
|
||||
// exceed.
|
||||
func (sm *ServerManager) StartServerManager() {
|
||||
defaultTimeout := 5 * time.Second // FIXME(sean@): This is a bullshit value
|
||||
var rebalanceTimer *time.Timer
|
||||
func() {
|
||||
sm.serverConfigLock.Lock()
|
||||
@ -312,8 +311,9 @@ func (sm *ServerManager) StartServerManager() {
|
||||
}
|
||||
var serverCfg serverConfig
|
||||
serverCfg = serverCfgPtr.(serverConfig)
|
||||
rebalanceTimer = time.NewTimer(defaultTimeout)
|
||||
serverCfg.rebalanceTimer = rebalanceTimer
|
||||
serverCfg.resetRebalanceTimer(sm)
|
||||
rebalanceTimer = serverCfg.rebalanceTimer
|
||||
sm.serverConfigValue.Store(serverCfg)
|
||||
}()
|
||||
|
||||
for {
|
||||
|
Loading…
x
Reference in New Issue
Block a user