open-nomad/command/agent/util.go

12 lines
228 B
Go

package agent
import (
"math/rand"
"time"
)
// Returns a random stagger interval between 0 and the duration
func randomStagger(intv time.Duration) time.Duration {
return time.Duration(uint64(rand.Int63()) % uint64(intv))
}