main: do not pass id to etcd

This commit is contained in:
Xiang Li 2014-07-21 16:45:03 -07:00 committed by Yicheng Qin
parent 30099d9135
commit 061fad12a9

View File

@ -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)