Skip to content

Commit

Permalink
Make periodic fingerprinting log the error
Browse files Browse the repository at this point in the history
  • Loading branch information
dadgar committed Nov 6, 2015
1 parent f43c067 commit 10e1906
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -455,16 +455,14 @@ func (c *Client) fingerprint() error {
return nil
}

// fingerprintPeriodic runs a fingerprinter at the specified duration. If the
// fingerprinter returns an error, the function exits.
// fingerprintPeriodic runs a fingerprinter at the specified duration.
func (c *Client) fingerprintPeriodic(name string, f fingerprint.Fingerprint, d time.Duration) {
c.logger.Printf("[DEBUG] client: periodically fingerprinting %v at duration %v", name, d)
for {
select {
case <-time.After(d):
if _, err := f.Fingerprint(c.config, c.config.Node); err != nil {
c.logger.Printf("[DEBUG] client: disabling periodic fingerprinting for %v: %v", name, err)
return
c.logger.Printf("[DEBUG] client: periodic fingerprinting for %v failed: %v", name, err)
}
case <-c.shutdownCh:
return
Expand Down

0 comments on commit 10e1906

Please sign in to comment.