mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
httpproxy: init the rand that we use to randomize endpoints
This is actually does not change anything. The endpoints are already randomized before feeding into proxy. But it makes the proxy more safe.
This commit is contained in:
parent
3ed5d28e2e
commit
c73e8fd946
@ -27,6 +27,10 @@ const defaultRefreshInterval = 30000 * time.Millisecond
|
||||
|
||||
var once sync.Once
|
||||
|
||||
func init() {
|
||||
rand.Seed(time.Now().UnixNano())
|
||||
}
|
||||
|
||||
func newDirector(urlsFunc GetProxyURLs, failureWait time.Duration, refreshInterval time.Duration) *director {
|
||||
d := &director{
|
||||
uf: urlsFunc,
|
||||
|
Loading…
x
Reference in New Issue
Block a user