From 5d54225f9dbed108c451f5406b7dea8232508a16 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Mon, 14 Nov 2022 19:04:34 +0800 Subject: [PATCH] etcd conf --- pkg/grpc-etcdv3/getcdv3/register.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/grpc-etcdv3/getcdv3/register.go b/pkg/grpc-etcdv3/getcdv3/register.go index c9498a6bd..a61615b53 100644 --- a/pkg/grpc-etcdv3/getcdv3/register.go +++ b/pkg/grpc-etcdv3/getcdv3/register.go @@ -139,8 +139,7 @@ func registerConf(key, conf string) { panic(err.Error()) } //lease - ctx, cancel := context.WithCancel(context.Background()) - defer cancel() + ctx, _ := context.WithCancel(context.Background()) resp, err := cli.Grant(ctx, 10) if err != nil { panic(err.Error()) @@ -162,5 +161,7 @@ func RegisterConf() { if err != nil { panic(err.Error()) } + fmt.Println("start register", secretMD5) registerConf(GetPrefix(config.Config.Etcd.EtcdSchema, config.ConfName), string(confBytes)) + fmt.Println("etcd register conf ok") }