mirror of https://github.com/status-im/consul.git
use existing randomStagger
This commit is contained in:
parent
fc0331ddfc
commit
7b4720a957
|
@ -3,7 +3,6 @@ package agent
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"math/rand"
|
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
@ -211,7 +210,7 @@ func (l *localState) UpdateCheck(checkID, status, output string) {
|
||||||
if _, ok := l.deferCheck[checkID]; !ok {
|
if _, ok := l.deferCheck[checkID]; !ok {
|
||||||
var intv time.Duration
|
var intv time.Duration
|
||||||
if l.config.CheckUpdateStagger {
|
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 {
|
} else {
|
||||||
intv = l.config.CheckUpdateInterval
|
intv = l.config.CheckUpdateInterval
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue