mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Actually randomize the splay
This commit is contained in:
@@ -2,6 +2,7 @@ package client
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
@@ -261,8 +262,12 @@ WAIT:
|
||||
|
||||
if restart || len(signals) != 0 {
|
||||
if splay != 0 {
|
||||
ns := splay.Nanoseconds()
|
||||
offset := rand.Int63n(ns)
|
||||
t := time.Duration(offset)
|
||||
|
||||
select {
|
||||
case <-time.After(time.Duration(splay)):
|
||||
case <-time.After(t):
|
||||
case <-tm.shutdownCh:
|
||||
return
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -ex
|
||||
|
||||
CONSUL_VERSION="0.7.0"
|
||||
CONSUL_VERSION="0.7.2"
|
||||
CURDIR=`pwd`
|
||||
|
||||
echo Fetching Consul...
|
||||
|
||||
Reference in New Issue
Block a user