Skip to content

Commit

Permalink
simplify retry logic
Browse files Browse the repository at this point in the history
  • Loading branch information
chelseakomlo committed Mar 1, 2018
1 parent d635323 commit bf72619
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
}
Expand Down

0 comments on commit bf72619

Please sign in to comment.