telemetry: Use int64 constant for duration interval

Otherwise it overflows int type on 32-bit builds
This commit is contained in:
Matthew Holt 2018-05-10 09:41:57 -06:00
parent b321c00a8f
commit c667f81866
No known key found for this signature in database
GPG key ID: 2A349DD577D586A5

View file

@ -209,7 +209,7 @@ func emit(final bool) error {
// ensure we won't slam the telemetry server; add a little variance
if reply.NextUpdate < 1*time.Second {
reply.NextUpdate = defaultUpdateInterval + time.Duration(rand.Intn(int(1*time.Minute)))
reply.NextUpdate = defaultUpdateInterval + time.Duration(rand.Int63n(int64(1*time.Minute)))
}
// schedule the next update (if this wasn't the last one and