Use consul/lib's RandomStagger

Removes four redundant copies of the method in the process.
This commit is contained in:
Sean Chittenden
2016-05-03 00:15:29 -07:00
parent a1cb3f14d0
commit 7db2eb03c4
11 changed files with 11 additions and 72 deletions

View File

@@ -16,6 +16,7 @@ import (
"time"
"github.com/armon/go-metrics"
"github.com/hashicorp/consul/lib"
"github.com/hashicorp/go-checkpoint"
"github.com/hashicorp/go-syslog"
"github.com/hashicorp/logutils"
@@ -334,7 +335,7 @@ func (c *Command) setupAgent(config *Config, logOutput io.Writer) error {
// Do an immediate check within the next 30 seconds
go func() {
time.Sleep(randomStagger(30 * time.Second))
time.Sleep(lib.RandomStagger(30 * time.Second))
c.checkpointResults(checkpoint.Check(updateParams))
}()
}