Don't assume that time.Duration can be represented by an int. (#9554)

This commit is contained in:
ncabatoff 2020-07-22 12:04:52 -04:00 committed by GitHub
parent 7484fd7c72
commit 73b8696b46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -121,7 +121,7 @@ func (m *ClusterMetricSink) newGaugeCollectionProcessWithClock(
// If we knew all the procsses in advance, we could just schedule them
// evenly, but a new one could be added per secret engine.
func (p *GaugeCollectionProcess) delayStart() bool {
randomDelay := time.Duration(rand.Intn(int(p.currentInterval)))
randomDelay := time.Duration(rand.Int63n(int64(p.currentInterval)))
// A Timer might be better, but then we'd have to simulate
// one of those too?
delayTick := p.clock.NewTicker(randomDelay)