From 7b4720a9574402f77f647ee95fd9a4488d97acf4 Mon Sep 17 00:00:00 2001 From: artushin Date: Thu, 23 Apr 2015 17:08:17 -0500 Subject: [PATCH] use existing randomStagger --- command/agent/local.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/command/agent/local.go b/command/agent/local.go index 3726b53c7f..ea4e40db8b 100644 --- a/command/agent/local.go +++ b/command/agent/local.go @@ -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 }