use existing randomStagger

This commit is contained in:
artushin 2015-04-23 17:08:17 -05:00
parent 1ebc1cf916
commit 88bfdd45ef
1 changed files with 1 additions and 2 deletions

View File

@ -3,7 +3,6 @@ package agent
import (
"fmt"
"log"
"math/rand"
"reflect"
"strings"
"sync"
@ -211,7 +210,7 @@ func (l *localState) UpdateCheck(checkID, status, output string) {
if _, ok := l.deferCheck[checkID]; !ok {
var intv time.Duration
if l.config.CheckUpdateStagger {
intv = time.Duration(uint64(l.config.CheckUpdateInterval)/2 + uint64(rand.Int63())%uint64(l.config.CheckUpdateInterval))
intv = time.Duration(uint64(l.config.CheckUpdateInterval)/2) + randomStagger(l.config.CheckUpdateInterval)
} else {
intv = l.config.CheckUpdateInterval
}