Merge pull request #1768 from hashicorp/b-squelch-spammy-consul-errors

Only log consul errors once since last succesful run
This commit is contained in:
Michael Schurter 2016-09-30 09:03:18 -07:00 committed by GitHub
commit c7ed409cf0

View file

@ -1607,11 +1607,17 @@ DISCOLOOP:
func (c *Client) consulReaper() {
ticker := time.NewTicker(consulReaperIntv)
defer ticker.Stop()
lastok := true
for {
select {
case <-ticker.C:
if err := c.consulReaperImpl(); err != nil {
if lastok {
c.logger.Printf("[ERR] consul.client: error reaping services in consul: %v", err)
lastok = false
}
} else {
lastok = true
}
case <-c.shutdownCh:
return