Skip to content

Commit

Permalink
Don't assume that time.Duration can be represented by an int. (#9554)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncabatoff committed Jul 22, 2020
1 parent 70bb5fe commit 4b81ede
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helper/metricsutil/gauge_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4b81ede

Please sign in to comment.