Cast rateMs when calculating NewTicker duration to avoid overflow on Raspberry PI

This commit is contained in:
Anders Green 2019-10-22 17:05:15 +02:00
parent 6360f4c90f
commit 8f6cac9aef
1 changed files with 1 additions and 1 deletions

View File

@ -17,7 +17,7 @@ type Sampler struct {
func NewSampler(consumer *Consumer, items []*Item, triggers []*Trigger, options config.Options, fileVariables map[string]string, rateMs int) *Sampler {
ticker := time.NewTicker(time.Duration(rateMs * int(time.Millisecond)))
ticker := time.NewTicker(time.Duration(uint32(rateMs) * uint32(time.Millisecond)))
sampler := &Sampler{
consumer,