Merge pull request #2995 from hashicorp/sethvargo/renewer_bug

Do not double-convert to seconds
This commit is contained in:
Seth Vargo 2017-07-11 17:12:54 -07:00 committed by GitHub
commit 4dd846657c

View file

@ -296,7 +296,7 @@ func (r *Renewer) sleepDuration(base time.Duration) time.Duration {
sleep = sleep / 3.0
// Use a randomness so many clients do not hit Vault simultaneously.
sleep = sleep * r.random.Float64()
sleep = sleep * (r.random.Float64() + 1) / 2.0
return time.Duration(sleep) * time.Second
return time.Duration(sleep)
}