From 061fad12a98dd65587a25f14f539166a7a5904a8 Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Mon, 21 Jul 2014 16:45:03 -0700 Subject: [PATCH] main: do not pass id to etcd --- main.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/main.go b/main.go index 56807bcb8..6af6b0c34 100644 --- a/main.go +++ b/main.go @@ -4,11 +4,9 @@ import ( "crypto/tls" "fmt" "log" - "math/rand" "net" "net/http" "os" - "time" "github.com/coreos/etcd/config" "github.com/coreos/etcd/etcd" @@ -28,7 +26,7 @@ func main() { os.Exit(0) } - e := etcd.New(config, genId()) + e := etcd.New(config) go e.Run() corsInfo, err := ehttp.NewCORSInfo(config.CorsOrigins) @@ -42,11 +40,6 @@ func main() { serve("etcd", config.BindAddr, config.EtcdTLSInfo(), corsInfo, e) } -func genId() int64 { - r := rand.New(rand.NewSource(int64(time.Now().Nanosecond()))) - return r.Int63() -} - func serve(who string, addr string, tinfo *config.TLSInfo, cinfo *ehttp.CORSInfo, handler http.Handler) { t, terr := tinfo.ServerConfig() l, err := net.Listen("tcp", addr)