Do not double-convert to seconds

This commit is contained in:
Seth Vargo 2017-07-11 16:05:04 -07:00
parent 751501dced
commit c77986d03e
No known key found for this signature in database
GPG Key ID: C921994F9C27E0FF
1 changed files with 2 additions and 2 deletions

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)
}