mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
main: do not pass id to etcd
This commit is contained in:
parent
30099d9135
commit
061fad12a9
9
main.go
9
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user