client: log when server list changes

Stop logging in the happy path when nothing has changed.
This commit is contained in:
Michael Schurter 2019-05-13 15:42:55 -07:00
parent 48db8135da
commit 3b1f8991a1
1 changed files with 2 additions and 1 deletions

View File

@ -208,10 +208,11 @@ func (m *Manager) SetServers(servers Servers) bool {
// This prevents unnecessary shuffling of a failed server that was moved to the
// bottom of the list
if equal {
m.logger.Debug("Not replacing server list, current server list is identical to servers discovered in Consul")
return !equal
}
m.logger.Debug("new server list", "new_servers", servers, "old_servers", m.servers)
// Randomize the incoming servers
servers.shuffle()
m.servers = servers