mirror of
https://github.com/kemko/nomad.git
synced 2026-01-08 19:35:41 +03:00
simplify retry logic
This commit is contained in:
@@ -1544,9 +1544,6 @@ func (c *Client) watchNodeUpdates() {
|
||||
for {
|
||||
select {
|
||||
case <-timer.C:
|
||||
if !hasChanged {
|
||||
continue
|
||||
}
|
||||
c.logger.Printf("[DEBUG] client: state changed, updating node and re-registering.")
|
||||
|
||||
// Update the config copy.
|
||||
@@ -1558,9 +1555,12 @@ func (c *Client) watchNodeUpdates() {
|
||||
c.retryRegisterNode()
|
||||
|
||||
hasChanged = false
|
||||
timer.Reset(c.retryIntv(nodeUpdateRetryIntv))
|
||||
case <-c.triggerNodeUpdate:
|
||||
if hasChanged {
|
||||
continue
|
||||
}
|
||||
hasChanged = true
|
||||
timer.Reset(c.retryIntv(nodeUpdateRetryIntv))
|
||||
case <-c.shutdownCh:
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user